Skip to content

Commit

Permalink
Updated Veneer stub
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Wright <tom@inflatablecookie.com>
  • Loading branch information
betterthanclay committed Sep 27, 2022
1 parent 5ba8421 commit c1a6592
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 7 deletions.
14 changes: 10 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"require": {
"php": "^8.0",

"decodelabs/veneer": "^0.10",
"decodelabs/exceptional": "^0.4"
"decodelabs/exceptional": "^0.4",
"decodelabs/veneer": "^0.10.7"
},
"require-dev": {
"phpunit/phpunit": "^9",
Expand All @@ -21,7 +21,9 @@
"php-parallel-lint/php-parallel-lint": "^1.3",
"symplify/easy-coding-standard": "^11",

"decodelabs/phpstan-decodelabs": "^0.6"
"decodelabs/phpstan-decodelabs": "^0.6",
"decodelabs/atlas": "^0.10.4",
"decodelabs/terminus": "^0.8.4"
},
"autoload": {
"psr-4": {
Expand All @@ -43,16 +45,20 @@
},
"scripts": {
"analyze": "phpstan analyze --no-progress",
"clear-phpstan": "phpstan clear-result-cache",
"ecs": "ecs check --no-progress-bar",
"ecs-fix": "ecs check --no-progress-bar --fix",
"lint": "parallel-lint src/ stubs/ ecs.php",
"eclint": "eclint check src/ stubs/ ecs.php",
"eclint-fix": "eclint fix src/ stubs/ ecs.php",
"non-ascii": "! LC_ALL=C.UTF-8 find src/ -type f -name \"*.php\" -print0 | xargs -0 -- grep -PHn \"[^ -~]\" | grep -v '// @ignore-non-ascii$'",
"veneer-stub": "vendor/bin/veneer-stub",
"check": [
"@composer update",
"@veneer-stub",
"@clear-phpstan",
"@analyze",
"@ecs",
"@ecs-fix",
"@lint",
"@eclint",
"@non-ascii"
Expand Down
27 changes: 24 additions & 3 deletions stubs/DecodeLabs/Typify.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,30 @@
* It should not be included in your projects.
*/
namespace DecodeLabs;

use DecodeLabs\Veneer\Proxy;
use DecodeLabs\Veneer\ProxyTrait;
use DecodeLabs\Typify\Detector as Inst;
class Typify implements Proxy { use ProxyTrait;
const VENEER = 'Typify';
const VENEER_TARGET = Inst::class;};

class Typify implements Proxy
{
use ProxyTrait;

const VENEER = 'DecodeLabs\Typify';
const VENEER_TARGET = Inst::class;

public static Inst $instance;

public static function detect(string $path, string $default = 'application/octet-stream'): string {
return static::$instance->detect(...func_get_args());
}
public static function getTypeFor(string $extension, ?string $default = NULL): ?string {
return static::$instance->getTypeFor(...func_get_args());
}
public static function getExtensionFor(string $type): ?string {
return static::$instance->getExtensionFor(...func_get_args());
}
public static function getExtensionsFor(string $type): array {
return static::$instance->getExtensionsFor(...func_get_args());
}
};

0 comments on commit c1a6592

Please sign in to comment.