Completed
Push — develop ( 045e9f...7fb967 )
by Zack
17:47
created
vendor/brianhenryie/strauss/src/Autoload.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -12,8 +12,7 @@  discard block
 block discarded – undo
12 12
 use League\Flysystem\Adapter\Local;
13 13
 use League\Flysystem\Filesystem;
14 14
 
15
-class Autoload
16
-{
15
+class Autoload {
17 16
 
18 17
     /** @var Filesystem */
19 18
     protected $filesystem;
@@ -36,16 +35,14 @@  discard block
 block discarded – undo
36 35
      * @param string $workingDir
37 36
      * @param array<string, array<string>> $files
38 37
      */
39
-    public function __construct(StraussConfig $config, string $workingDir, array $discoveredFilesAutoloaders)
40
-    {
38
+    public function __construct(StraussConfig $config, string $workingDir, array $discoveredFilesAutoloaders) {
41 39
         $this->config = $config;
42 40
         $this->workingDir = $workingDir;
43 41
         $this->discoveredFilesAutoloaders = $discoveredFilesAutoloaders;
44 42
         $this->filesystem = new Filesystem(new Local($workingDir));
45 43
     }
46 44
 
47
-    public function generate()
48
-    {
45
+    public function generate() {
49 46
 
50 47
         if (! $this->config->isClassmapOutput()) {
51 48
             return;
@@ -119,8 +116,7 @@  discard block
 block discarded – undo
119 116
         return $dirname;
120 117
     }
121 118
 
122
-    protected function generateFilesAutoloader()
123
-    {
119
+    protected function generateFilesAutoloader() {
124 120
 
125 121
         // Hyphen used to match WordPress Coding Standards.
126 122
         $outputFilename = "autoload-files.php";
@@ -157,8 +153,7 @@  discard block
 block discarded – undo
157 153
         file_put_contents($targetDirectory . $outputFilename, ob_get_clean());
158 154
     }
159 155
 
160
-    protected function generateAutoloadPhp()
161
-    {
156
+    protected function generateAutoloadPhp() {
162 157
 
163 158
         $autoloadPhp = <<<'EOD'
164 159
 <?php
Please login to merge, or discard this patch.
vendor/brianhenryie/strauss/src/Cleanup.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -11,8 +11,7 @@  discard block
 block discarded – undo
11 11
 use RecursiveDirectoryIterator;
12 12
 use Symfony\Component\Finder\Finder;
13 13
 
14
-class Cleanup
15
-{
14
+class Cleanup {
16 15
 
17 16
     /** @var Filesystem */
18 17
     protected Filesystem $filesystem;
@@ -21,8 +20,7 @@  discard block
 block discarded – undo
21 20
 
22 21
     protected string $vendorDirectory = 'vendor'. DIRECTORY_SEPARATOR;
23 22
     
24
-    public function __construct(StraussConfig $config, string $workingDir)
25
-    {
23
+    public function __construct(StraussConfig $config, string $workingDir) {
26 24
 
27 25
         $this->isDeleteVendorFiles = $config->isDeleteVendorFiles();
28 26
         
@@ -35,8 +33,7 @@  discard block
 block discarded – undo
35 33
      *
36 34
      * @param array $sourceFiles
37 35
      */
38
-    public function cleanup(array $sourceFiles)
39
-    {
36
+    public function cleanup(array $sourceFiles) {
40 37
 
41 38
         // TODO Don't do this if vendor is the target dir (i.e. in-situ updating).
42 39
 
Please login to merge, or discard this patch.
vendor/brianhenryie/strauss/src/FileEnumerator.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -13,8 +13,7 @@  discard block
 block discarded – undo
13 13
 use League\Flysystem\Filesystem;
14 14
 use Symfony\Component\Finder\Finder;
15 15
 
16
-class FileEnumerator
17
-{
16
+class FileEnumerator {
18 17
 
19 18
     /**
20 19
      * The only path variable with a leading slash.
@@ -76,8 +75,7 @@  discard block
 block discarded – undo
76 75
     /**
77 76
      * Read the autoload keys of the dependencies and generate a list of the files referenced.
78 77
      */
79
-    public function compileFileList()
80
-    {
78
+    public function compileFileList() {
81 79
 
82 80
         // TODO: read 'vendor' from composer.json.
83 81
         $prefixToRemove = $this->workingDir .'vendor'. DIRECTORY_SEPARATOR;
Please login to merge, or discard this patch.
vendor/brianhenryie/strauss/src/Licenser.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -22,8 +22,7 @@  discard block
 block discarded – undo
22 22
 use League\Flysystem\Filesystem;
23 23
 use Symfony\Component\Finder\Finder;
24 24
 
25
-class Licenser
26
-{
25
+class Licenser {
27 26
 
28 27
     protected string $workingDir;
29 28
 
@@ -51,8 +50,7 @@  discard block
 block discarded – undo
51 50
      * @param array $dependencies Whose folders are searched for existing license.txt files.
52 51
      * @param string $author To add to each modified file's header
53 52
      */
54
-    public function __construct(StraussConfig $config, string $workingDir, array $dependencies, string $author)
55
-    {
53
+    public function __construct(StraussConfig $config, string $workingDir, array $dependencies, string $author) {
56 54
         $this->workingDir = $workingDir;
57 55
         $this->dependencies = $dependencies;
58 56
         $this->author = $author;
@@ -92,8 +90,7 @@  discard block
 block discarded – undo
92 90
     /**
93 91
      * @see https://www.phpliveregex.com/p/A5y
94 92
      */
95
-    public function findLicenseFiles(?Finder $finder = null)
96
-    {
93
+    public function findLicenseFiles(?Finder $finder = null) {
97 94
 
98 95
         // Include all license files in the dependency path.
99 96
         $finder = $finder ?? new Finder();
@@ -132,8 +129,7 @@  discard block
 block discarded – undo
132 129
     /**
133 130
      * @param array<string, ComposerPackage> $modifiedFiles
134 131
      */
135
-    public function addInformationToUpdatedFiles(array $modifiedFiles)
136
-    {
132
+    public function addInformationToUpdatedFiles(array $modifiedFiles) {
137 133
 
138 134
         // e.g. "25-April-2021".
139 135
         $date = gmdate("d-F-Y", time());
Please login to merge, or discard this patch.
vendor/brianhenryie/strauss/src/Prefixer.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -9,8 +9,7 @@  discard block
 block discarded – undo
9 9
 use League\Flysystem\FileNotFoundException;
10 10
 use League\Flysystem\Filesystem;
11 11
 
12
-class Prefixer
13
-{
12
+class Prefixer {
14 13
     /** @var StraussConfig */
15 14
     protected $config;
16 15
 
@@ -28,8 +27,7 @@  discard block
 block discarded – undo
28 27
     /** @var array<string, ComposerPackage> */
29 28
     protected array $changedFiles = array();
30 29
 
31
-    public function __construct(StraussConfig $config, string $workingDir)
32
-    {
30
+    public function __construct(StraussConfig $config, string $workingDir) {
33 31
         $this->filesystem = new Filesystem(new Local($workingDir));
34 32
 
35 33
         $this->targetDirectory = $config->getTargetDirectory();
@@ -51,8 +49,7 @@  discard block
 block discarded – undo
51 49
      * @param array<string, ComposerPackage> $phpFileList
52 50
      * @throws FileNotFoundException
53 51
      */
54
-    public function replaceInFiles(array $namespaceChanges, array $classChanges, array $phpFileList)
55
-    {
52
+    public function replaceInFiles(array $namespaceChanges, array $classChanges, array $phpFileList) {
56 53
 
57 54
         foreach ($phpFileList as $sourceRelativeFilePathFromVendor => $package) {
58 55
             // Skip excluded namespaces.
@@ -109,8 +106,7 @@  discard block
 block discarded – undo
109 106
      *
110 107
      * @return string The updated text.
111 108
      */
112
-    public function replaceNamespace($contents, $originalNamespace, $replacement)
113
-    {
109
+    public function replaceNamespace($contents, $originalNamespace, $replacement) {
114 110
 
115 111
         // When namespaces exist inside strings...
116 112
         $searchNamespace =
@@ -206,8 +202,7 @@  discard block
 block discarded – undo
206 202
      * @return array|string|string[]|null
207 203
      * @throws \Exception
208 204
      */
209
-    public function replaceClassname($contents, $originalClassname, $classnamePrefix)
210
-    {
205
+    public function replaceClassname($contents, $originalClassname, $classnamePrefix) {
211 206
         $searchClassname = preg_quote($originalClassname, '/');
212 207
 
213 208
         // This could be more specific if we could enumerate all preceeding and proceeding words ("new", "("...).
Please login to merge, or discard this patch.
vendor/brianhenryie/strauss/src/ChangeEnumerator.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -10,8 +10,7 @@  discard block
 block discarded – undo
10 10
 use BrianHenryIE\Strauss\Composer\ComposerPackage;
11 11
 use BrianHenryIE\Strauss\Composer\Extra\StraussConfig;
12 12
 
13
-class ChangeEnumerator
14
-{
13
+class ChangeEnumerator {
15 14
 
16 15
     protected string $namespacePrefix;
17 16
     protected string $classmapPrefix;
@@ -37,8 +36,7 @@  discard block
 block discarded – undo
37 36
      * ChangeEnumerator constructor.
38 37
      * @param \BrianHenryIE\Strauss\Composer\Extra\StraussConfig $config
39 38
      */
40
-    public function __construct(StraussConfig $config)
41
-    {
39
+    public function __construct(StraussConfig $config) {
42 40
         $this->namespacePrefix = $config->getNamespacePrefix();
43 41
         $this->classmapPrefix = $config->getClassmapPrefix();
44 42
 
@@ -78,8 +76,7 @@  discard block
 block discarded – undo
78 76
      * @param string $dir
79 77
      * @param array<string, ComposerPackage> $relativeFilepaths
80 78
      */
81
-    public function findInFiles($dir, $relativeFilepaths)
82
-    {
79
+    public function findInFiles($dir, $relativeFilepaths) {
83 80
 
84 81
         foreach ($relativeFilepaths as $relativeFilepath => $package) {
85 82
             foreach ($this->excludePackagesFromPrefixing as $excludePackagesName) {
@@ -172,8 +169,7 @@  discard block
 block discarded – undo
172 169
         );
173 170
     }
174 171
 
175
-    protected function addDiscoveredNamespaceChange(string $namespace)
176
-    {
172
+    protected function addDiscoveredNamespaceChange(string $namespace) {
177 173
 
178 174
         foreach ($this->excludeNamespacesFromPrefixing as $excludeNamespace) {
179 175
             if (0 === strpos($namespace, $excludeNamespace)) {
Please login to merge, or discard this patch.
vendor/brianhenryie/strauss/src/Console/Commands/Compose.php 1 patch
Braces   +10 added lines, -20 removed lines patch added patch discarded remove patch
@@ -17,8 +17,7 @@  discard block
 block discarded – undo
17 17
 use Symfony\Component\Console\Input\InputInterface;
18 18
 use Symfony\Component\Console\Output\OutputInterface;
19 19
 
20
-class Compose extends Command
21
-{
20
+class Compose extends Command {
22 21
     /** @var string */
23 22
     protected string $workingDir;
24 23
 
@@ -41,8 +40,7 @@  discard block
 block discarded – undo
41 40
     /**
42 41
      * @return void
43 42
      */
44
-    protected function configure()
45
-    {
43
+    protected function configure() {
46 44
         $this->setName('compose');
47 45
         $this->setDescription("Copy composer's `require` and prefix their namespace and classnames.");
48 46
         $this->setHelp('');
@@ -93,8 +91,7 @@  discard block
 block discarded – undo
93 91
      *
94 92
      * @throws Exception
95 93
      */
96
-    protected function loadProjectComposerPackage()
97
-    {
94
+    protected function loadProjectComposerPackage() {
98 95
 
99 96
         $this->projectComposerPackage = new ProjectComposerPackage($this->workingDir . 'composer.json');
100 97
 
@@ -114,8 +111,7 @@  discard block
 block discarded – undo
114 111
      *
115 112
      * @see Compose::flatDependencyTree
116 113
      */
117
-    protected function buildDependencyList()
118
-    {
114
+    protected function buildDependencyList() {
119 115
 
120 116
         $requiredPackageNames = $this->config->getPackages();
121 117
 
@@ -178,8 +174,7 @@  discard block
 block discarded – undo
178 174
 
179 175
     protected FileEnumerator $fileEnumerator;
180 176
 
181
-    protected function enumerateFiles()
182
-    {
177
+    protected function enumerateFiles() {
183 178
 
184 179
         $this->fileEnumerator = new FileEnumerator(
185 180
             $this->flatDependencyTree,
@@ -191,8 +186,7 @@  discard block
 block discarded – undo
191 186
     }
192 187
 
193 188
     // 3. Copy autoloaded files for each
194
-    protected function copyFiles()
195
-    {
189
+    protected function copyFiles() {
196 190
 
197 191
         $this->copier = new Copier(
198 192
             $this->fileEnumerator->getAllFilesAndDependencyList(),
@@ -206,8 +200,7 @@  discard block
 block discarded – undo
206 200
     }
207 201
 
208 202
     // 4. Determine namespace and classname changes
209
-    protected function determineChanges()
210
-    {
203
+    protected function determineChanges() {
211 204
 
212 205
         $this->changeEnumerator = new ChangeEnumerator($this->config);
213 206
 
@@ -218,8 +211,7 @@  discard block
 block discarded – undo
218 211
 
219 212
     // 5. Update namespaces and class names.
220 213
     // Replace references to updated namespaces and classnames throughout the dependencies.
221
-    protected function performReplacements()
222
-    {
214
+    protected function performReplacements() {
223 215
         $this->replacer = new Prefixer($this->config, $this->workingDir);
224 216
 
225 217
         $namespaces = $this->changeEnumerator->getDiscoveredNamespaceReplacements();
@@ -248,8 +240,7 @@  discard block
 block discarded – undo
248 240
     /**
249 241
      * 6. Generate autoloader.
250 242
      */
251
-    protected function generateAutoloader()
252
-    {
243
+    protected function generateAutoloader() {
253 244
 
254 245
         $files = $this->fileEnumerator->getFilesAutoloaders();
255 246
 
@@ -264,8 +255,7 @@  discard block
 block discarded – undo
264 255
      * Delete source files if desired.
265 256
      * Delete empty directories in destination.
266 257
      */
267
-    protected function cleanUp()
268
-    {
258
+    protected function cleanUp() {
269 259
 
270 260
         $cleanup = new Cleanup($this->config, $this->workingDir);
271 261
 
Please login to merge, or discard this patch.
vendor/brianhenryie/strauss/src/Console/Application.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -5,13 +5,11 @@
 block discarded – undo
5 5
 use BrianHenryIE\Strauss\Console\Commands\Compose;
6 6
 use Symfony\Component\Console\Application as BaseApplication;
7 7
 
8
-class Application extends BaseApplication
9
-{
8
+class Application extends BaseApplication {
10 9
     /**
11 10
      * @param string $version
12 11
      */
13
-    public function __construct(string $version)
14
-    {
12
+    public function __construct(string $version) {
15 13
         parent::__construct('strauss', $version);
16 14
 
17 15
         $composeCommand = new Compose();
Please login to merge, or discard this patch.
vendor/paragonie/random_compat/lib/random_bytes_dev_urandom.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,8 +45,7 @@
 block discarded – undo
45 45
      *
46 46
      * @return string
47 47
      */
48
-    function random_bytes($bytes)
49
-    {
48
+    function random_bytes($bytes) {
50 49
         /** @var resource $fp */
51 50
         static $fp = null;
52 51
 
Please login to merge, or discard this patch.