@@ -54,6 +54,7 @@ |
||
54 | 54 | * This is the path of the composer.json file that triggered the bootstrap. |
55 | 55 | * @param TokenResolverFactoryInterface $token_resolver_factory |
56 | 56 | * Factory object to create token resolvers. |
57 | + * @param string $seed |
|
57 | 58 | */ |
58 | 59 | public function __construct($seed, TokenResolverFactoryInterface $token_resolver_factory = NULL) { |
59 | 60 | $this->seed = $seed; |
@@ -140,8 +140,7 @@ discard block |
||
140 | 140 | // found the file or not. |
141 | 141 | $finder->requireFile($this->seed); |
142 | 142 | return TRUE; |
143 | - } |
|
144 | - catch (ClassLoaderException $e) { |
|
143 | + } catch (ClassLoaderException $e) { |
|
145 | 144 | // If there was an error, inform PHP that the class could not be found. |
146 | 145 | return FALSE; |
147 | 146 | } |
@@ -182,8 +181,7 @@ discard block |
||
182 | 181 | // Get the real path of the prefix. |
183 | 182 | $real_path = $finder->find($this->seed); |
184 | 183 | $loader->{$loader_method}($partial_namespace, $real_path); |
185 | - } |
|
186 | - catch (ClassLoaderException $e) {} |
|
184 | + } catch (ClassLoaderException $e) {} |
|
187 | 185 | } |
188 | 186 | } |
189 | 187 | } |
@@ -25,6 +25,7 @@ discard block |
||
25 | 25 | * Sets the class map. |
26 | 26 | * |
27 | 27 | * @param array $class_map |
28 | + * @return void |
|
28 | 29 | */ |
29 | 30 | public function setClassMap(array $class_map); |
30 | 31 | |
@@ -32,6 +33,7 @@ discard block |
||
32 | 33 | * Sets the PSR class map. |
33 | 34 | * |
34 | 35 | * @param array[] $class_map |
36 | + * @return void |
|
35 | 37 | */ |
36 | 38 | public function setPsrClassMap(array $class_map); |
37 | 39 | |
@@ -39,6 +41,7 @@ discard block |
||
39 | 41 | * Sets the seed path. |
40 | 42 | * |
41 | 43 | * @param string $seed. |
44 | + * @return void |
|
42 | 45 | */ |
43 | 46 | public function setSeed($seed); |
44 | 47 |
@@ -4,13 +4,13 @@ |
||
4 | 4 | |
5 | 5 | // Register root dir |
6 | 6 | if (getenv('COMPOSER_CONFIGURATION_PATH') === false) { |
7 | - putenv('COMPOSER_CONFIGURATION_PATH=' . dirname(dirname(dirname(__DIR__)))); |
|
7 | + putenv('COMPOSER_CONFIGURATION_PATH='.dirname(dirname(dirname(__DIR__)))); |
|
8 | 8 | } |
9 | 9 | |
10 | 10 | define('COMPOSER_CONFIGURATION_PATH', getenv('COMPOSER_CONFIGURATION_PATH')); |
11 | 11 | |
12 | 12 | // Load Composer's autoloader. |
13 | -$loader = require __DIR__ . '/../../autoload.php'; |
|
13 | +$loader = require __DIR__.'/../../autoload.php'; |
|
14 | 14 | |
15 | 15 | $autoloader_init = new AutoloaderBootstrap($loader); |
16 | 16 | $autoloader_init->register(); |
@@ -136,7 +136,7 @@ |
||
136 | 136 | $token_name = $this->getToken(); |
137 | 137 | $delimiter = '/'; |
138 | 138 | $matches = array(); |
139 | - if (preg_match($delimiter . preg_quote($token_name) . '<(.+)>.*' . $delimiter, $this->path, $matches)) { |
|
139 | + if (preg_match($delimiter.preg_quote($token_name).'<(.+)>.*'.$delimiter, $this->path, $matches)) { |
|
140 | 140 | // Some arguments were found. |
141 | 141 | return explode(',', $matches[1]); |
142 | 142 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $core_path = $this->coreFinder->find($seed); |
52 | 52 | |
53 | 53 | // Create the RecursiveDirectoryIterator on the core directory. |
54 | - $core_directory = new \RecursiveDirectoryIterator($core_path . '/sites', \FilesystemIterator::KEY_AS_PATHNAME | \FilesystemIterator::CURRENT_AS_FILEINFO | \FilesystemIterator::SKIP_DOTS); |
|
54 | + $core_directory = new \RecursiveDirectoryIterator($core_path.'/sites', \FilesystemIterator::KEY_AS_PATHNAME | \FilesystemIterator::CURRENT_AS_FILEINFO | \FilesystemIterator::SKIP_DOTS); |
|
55 | 55 | // Create an iterator that will go recursively through all the files and |
56 | 56 | // directories -because of SELF_FIRST-. |
57 | 57 | $files_iterator = new \RecursiveIteratorIterator($core_directory, \RecursiveIteratorIterator::SELF_FIRST); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | // Check if the current directory corresponds to the contrib we are |
66 | 66 | // looking for. |
67 | 67 | if ($this->isWantedContrib($dir)) { |
68 | - return $this->cleanDirPath($dir->getPathName()) . $this->path; |
|
68 | + return $this->cleanDirPath($dir->getPathName()).$this->path; |
|
69 | 69 | } |
70 | 70 | } |
71 | 71 | throw new ClassLoaderException(sprintf('Drupal module "%s" could not be found in the Drupal tree that contains: %s.', $this->moduleName, $seed)); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | * TRUE if the contrib is detected. FALSE otherwise. |
81 | 81 | */ |
82 | 82 | protected function isWantedContrib(\SplFileInfo $dir) { |
83 | - $info_file = $this->cleanDirPath($dir->getPathName()) . DIRECTORY_SEPARATOR . $this->moduleName . '.info'; |
|
83 | + $info_file = $this->cleanDirPath($dir->getPathName()).DIRECTORY_SEPARATOR.$this->moduleName.'.info'; |
|
84 | 84 | return file_exists($info_file); |
85 | 85 | } |
86 | 86 |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | // up and up and up until we reach the Drupal root. |
23 | 23 | do { |
24 | 24 | if ($this->isDrupalRoot($directory)) { |
25 | - return $directory . $this->path; |
|
25 | + return $directory.$this->path; |
|
26 | 26 | } |
27 | 27 | } |
28 | 28 | while ($directory = $this->getParentDirectory($directory)); |
@@ -43,12 +43,12 @@ discard block |
||
43 | 43 | * TRUE if the passed directory is the Drupal root. |
44 | 44 | */ |
45 | 45 | protected function isDrupalRoot($directory) { |
46 | - if (!empty($directory) && is_dir($directory) && file_exists($directory . DIRECTORY_SEPARATOR . '/index.php')) { |
|
46 | + if (!empty($directory) && is_dir($directory) && file_exists($directory.DIRECTORY_SEPARATOR.'/index.php')) { |
|
47 | 47 | // Drupal 7 root. |
48 | 48 | // We check for the presence of 'modules/field/field.module' to differentiate this from a D6 site |
49 | - return (file_exists($directory . DIRECTORY_SEPARATOR . 'includes/common.inc') |
|
50 | - && file_exists($directory . DIRECTORY_SEPARATOR . 'misc/drupal.js') |
|
51 | - && file_exists($directory . DIRECTORY_SEPARATOR . 'modules/field/field.module')); |
|
49 | + return (file_exists($directory.DIRECTORY_SEPARATOR.'includes/common.inc') |
|
50 | + && file_exists($directory.DIRECTORY_SEPARATOR.'misc/drupal.js') |
|
51 | + && file_exists($directory.DIRECTORY_SEPARATOR.'modules/field/field.module')); |
|
52 | 52 | } |
53 | 53 | return FALSE; |
54 | 54 | } |