1 | <?php |
||
25 | final class ScriptHandler |
||
26 | { |
||
27 | const WEB_BUNDLE_PATH = 'vendor/kreta/kreta/src/Kreta/Bundle/WebBundle'; |
||
28 | const BIN_NPM = '../../../../../../../bin/npm'; |
||
29 | |||
30 | /** |
||
31 | * Executes the npm install command in the web bundle directory. |
||
32 | * |
||
33 | * @param Event $event The command event |
||
34 | */ |
||
35 | public static function npmInstall(Event $event) |
||
46 | |||
47 | /** |
||
48 | * Executes the webpack command as NPM script in the web bundle directory. |
||
49 | */ |
||
50 | public static function webpack() |
||
58 | |||
59 | /** |
||
60 | * Private method that executes all the logic about |
||
61 | * command with Symfony process component. |
||
62 | * |
||
63 | * @param string $cmd The command itself |
||
64 | * @param int $timeout The timeout |
||
65 | */ |
||
66 | private static function executeCommand($cmd, $timeout = 600) |
||
80 | |||
81 | /** |
||
82 | * Private method that manages the options of commands. |
||
83 | * |
||
84 | * @param Event $event The command event |
||
85 | * |
||
86 | * @return array |
||
87 | */ |
||
88 | private static function getOptions(Event $event) |
||
100 | } |
||
101 |
Late static binding only has effect in subclasses. A
final
class cannot be extended anymore so late static binding cannot occurr. Consider replacingstatic::
withself::
.To learn more about late static binding, please refer to the PHP core documentation.