Skip to content

Commit 75771ab

Browse files
committed
Changed namespace to Pds\Skeleton\ and collapsed directories.
1 parent fddf89d commit 75771ab

File tree

7 files changed

+18
-15
lines changed

7 files changed

+18
-15
lines changed

bin/pdsskeleton

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ foreach ($autoloadFiles as $autoloadFile) {
1414
}
1515
}
1616

17-
use PDS\Skeleton\Console;
17+
use Pds\Skeleton\Console;
1818

1919
$console = new Console();
2020
$console->execute($argv);

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"homepage": "https://github.com/php-pds/skeleton",
66
"license": "CC-BY-SA-4.0",
77
"autoload": {
8-
"psr-4": { "PDS\\Skeleton\\": "src/PDS/Skeleton" }
8+
"psr-4": { "Pds\\Skeleton\\": "src/" }
99
},
1010
"bin": ["bin/pdsskeleton"]
1111
}

src/PDS/Skeleton/ComplianceValidator.php renamed to src/ComplianceValidator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace PDS\Skeleton;
3+
namespace Pds\Skeleton;
44

55
class ComplianceValidator
66
{
@@ -57,7 +57,7 @@ public function validate($lines)
5757
public function getFiles()
5858
{
5959
if ($this->files == null) {
60-
$files = scandir(__DIR__ . "/../../../../../../");
60+
$files = scandir(__DIR__ . "/../../../../");
6161
foreach ($files as $i => $file) {
6262
if (is_dir($file)) {
6363
$files[$i] .= "/";

src/PDS/Skeleton/Console.php renamed to src/Console.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
22

3-
namespace PDS\Skeleton;
3+
namespace Pds\Skeleton;
44

55
class Console
66
{
77
protected $commandsWhitelist = [
8-
'validate' => 'PDS\Skeleton\ComplianceValidator',
9-
'generate' => 'PDS\Skeleton\PackageGenerator',
8+
'validate' => 'Pds\Skeleton\ComplianceValidator',
9+
'generate' => 'Pds\Skeleton\PackageGenerator',
1010
];
1111

1212
public function execute($args)

src/PDS/Skeleton/PackageGenerator.php renamed to src/PackageGenerator.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
namespace PDS\Skeleton;
3+
namespace Pds\Skeleton;
44

5-
use PDS\Skeleton\ComplianceValidator;
5+
use Pds\Skeleton\ComplianceValidator;
66

77
class PackageGenerator
88
{
@@ -19,21 +19,24 @@ public function execute()
1919
public function createFiles($validatorResults, $root = null)
2020
{
2121
if ($root == null) {
22-
$root = realpath(__DIR__ . "/../../../../../../");
22+
$root = realpath(__DIR__ . "/../../../../");
2323
}
2424
$files = $this->createFileList($validatorResults);
25-
foreach ($files as $file) {
25+
$createdFiles = [];
26+
foreach ($files as $i => $file) {
2627
$isDir = substr($file, -1, 1) == '/';
2728
if ($isDir) {
2829
$path = $root . '/' . substr($file, 0, -1);
30+
$createdFiles[$file] = $path;
2931
mkdir($path, 0755);
3032
continue;
3133
}
3234
$path = $root . '/' . $file . '.md';
35+
$createdFiles[$file] = $file . '.md';
3336
file_put_contents($path, '');
3437
chmod($path, 0644);
3538
}
36-
return $files;
39+
return $createdFiles;
3740
}
3841

3942
public function createFileList($validatorResults)

tests/ComplianceValidatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
}
1313
}
1414

15-
use PDS\Skeleton\ComplianceValidator;
15+
use Pds\Skeleton\ComplianceValidator;
1616

1717
$tester = new ComplianceValidatorTest();
1818
// Test all 4 possible states.

tests/PackageGeneratorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
}
1313
}
1414

15-
use PDS\Skeleton\ComplianceValidator;
16-
use PDS\Skeleton\PackageGenerator;
15+
use Pds\Skeleton\ComplianceValidator;
16+
use Pds\Skeleton\PackageGenerator;
1717

1818
$tester = new PackageGeneratorTest();
1919
$tester->testGenerate_WithMissingBin_ReturnsBin();

0 commit comments

Comments
 (0)