Skip to content

Commit 311791f

Browse files
committed
Merge branch 'cleanup'
2 parents 716b320 + 96e0f15 commit 311791f

File tree

29 files changed

+297
-363
lines changed

29 files changed

+297
-363
lines changed

lk-util/Command/Generate/Concept/GenerateCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@ protected function handleOutput($lines): void
881881
$this->OutputFile = $file;
882882

883883
if (file_exists($file)) {
884-
$input = file_get_contents($file);
884+
$input = File::getContents($file);
885885
if ($input === $output) {
886886
Console::log('Nothing to do:', $file);
887887
return;
@@ -916,7 +916,7 @@ protected function handleOutput($lines): void
916916
Console::info($verb, $file);
917917
}
918918

919-
file_put_contents($file, $output);
919+
File::putContents($file, $output);
920920
}
921921

922922
/**

scripts/generate.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ function generated($commandOrFile): void
184184
generated($generateEntity);
185185
if ($save && $generateEntity->Entity !== null) {
186186
File::createDir(dirname($file));
187-
file_put_contents($file, Json::prettyPrint($generateEntity->Entity));
187+
File::putContents($file, Json::prettyPrint($generateEntity->Entity));
188188
generated($file);
189189
}
190190
}
@@ -206,14 +206,14 @@ function generated($commandOrFile): void
206206
}
207207
sort($attributes);
208208
$attributes = implode(\PHP_EOL, $attributes) . \PHP_EOL;
209-
if (file_get_contents($file) !== $attributes) {
209+
if (File::getContents($file) !== $attributes) {
210210
if (in_array('--check', $args)) {
211211
Console::info('Would replace', $file);
212212
Console::count(Level::ERROR);
213213
$status |= 1;
214214
} else {
215215
Console::info('Replacing', $file);
216-
file_put_contents($file, $attributes);
216+
File::putContents($file, $attributes);
217217
}
218218
} else {
219219
Console::log('Nothing to do:', $file);

src/Toolkit/Core/Catalog/Char.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77
/**
88
* Character sequences
99
*
10+
* @api
11+
*
1012
* @extends AbstractDictionary<string>
1113
*/
1214
final class Char extends AbstractDictionary
1315
{
14-
public const ALPHABETIC = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
15-
public const ALPHABETIC_LOWER = 'abcdefghijklmnopqrstuvwxyz';
16-
public const ALPHABETIC_UPPER = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
16+
public const ALPHA = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
17+
public const LOWER = 'abcdefghijklmnopqrstuvwxyz';
18+
public const UPPER = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
1719
public const NUMERIC = '0123456789';
1820
public const ALPHANUMERIC = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
1921
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace Salient\Core\Catalog;
4+
5+
use Salient\Core\AbstractEnumeration;
6+
7+
/**
8+
* File descriptors
9+
*
10+
* @api
11+
*
12+
* @extends AbstractEnumeration<int>
13+
*/
14+
final class FileDescriptor extends AbstractEnumeration
15+
{
16+
public const IN = 0;
17+
public const OUT = 1;
18+
public const ERR = 2;
19+
}

src/Toolkit/Core/Catalog/ProcessState.php

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/Toolkit/Core/Catalog/ProcessStream.php

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/Toolkit/Core/Catalog/Regex.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -192,24 +192,4 @@ final class Regex extends AbstractDictionary
192192
(?: \s* (?: \| | & ) (?&sp)* (?-1) )?
193193
)
194194
REGEX;
195-
196-
public static function delimit(
197-
string $regex,
198-
string $delimiter = '/'
199-
): string {
200-
return $delimiter
201-
. str_replace($delimiter, '\\' . $delimiter, $regex)
202-
. $delimiter;
203-
}
204-
205-
public static function anchorAndDelimit(
206-
string $regex,
207-
string $delimiter = '/'
208-
): string {
209-
return $delimiter
210-
. '^'
211-
. str_replace($delimiter, '\\' . $delimiter, $regex)
212-
. '$'
213-
. $delimiter;
214-
}
215195
}

src/Toolkit/Core/Exception/ProcessException.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,7 @@
44

55
use Salient\Core\AbstractException;
66

7+
/**
8+
* @api
9+
*/
710
class ProcessException extends AbstractException {}

src/Toolkit/Core/Exception/ProcessTimedOutException.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@
22

33
namespace Salient\Core\Exception;
44

5+
/**
6+
* @api
7+
*/
58
class ProcessTimedOutException extends ProcessException {}

0 commit comments

Comments
 (0)