@@ -36,18 +36,18 @@ discard block |
||
| 36 | 36 | { |
| 37 | 37 | $events = array(); |
| 38 | 38 | // YamlでParseしてがんばる |
| 39 | - $basePath = __DIR__ . '/../../../app/Plugin'; |
|
| 39 | + $basePath = __DIR__.'/../../../app/Plugin'; |
|
| 40 | 40 | $finder = Finder::create() |
| 41 | 41 | ->in($basePath) |
| 42 | 42 | ->directories() |
| 43 | 43 | ->depth(0); |
| 44 | 44 | |
| 45 | 45 | foreach ($finder as $dir) { |
| 46 | - $config = Yaml::parse(file_get_contents($dir->getRealPath() . '/config.yml')); |
|
| 46 | + $config = Yaml::parse(file_get_contents($dir->getRealPath().'/config.yml')); |
|
| 47 | 47 | |
| 48 | 48 | if (isset($config['form'])) { |
| 49 | 49 | foreach ($config['form'] as $event => $class) { |
| 50 | - $events[$event][] = '\\Plugin\\' . $config['code'] . '\\' . $class; |
|
| 50 | + $events[$event][] = '\\Plugin\\'.$config['code'].'\\'.$class; |
|
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $events = self::getEvents(); |
| 72 | 72 | |
| 73 | 73 | if (isset($events['onPreSetData'])) { |
| 74 | - foreach($events['onPreSetData'] as $formEventClass) { |
|
| 74 | + foreach ($events['onPreSetData'] as $formEventClass) { |
|
| 75 | 75 | $formEvent = new $formEventClass(); |
| 76 | 76 | $formEvent->onPreSetData($event); |
| 77 | 77 | } |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | $events = self::getEvents(); |
| 84 | 84 | |
| 85 | 85 | if (isset($events['onPostSetData'])) { |
| 86 | - foreach($events['onPostSetData'] as $formEventClass) { |
|
| 86 | + foreach ($events['onPostSetData'] as $formEventClass) { |
|
| 87 | 87 | $formEvent = new $formEventClass(); |
| 88 | 88 | $formEvent->onPostSetData($event); |
| 89 | 89 | } |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | $events = self::getEvents(); |
| 96 | 96 | |
| 97 | 97 | if (isset($events['onPreSubmit'])) { |
| 98 | - foreach($events['onPreSubmit'] as $formEventClass) { |
|
| 98 | + foreach ($events['onPreSubmit'] as $formEventClass) { |
|
| 99 | 99 | $formEvent = new $formEventClass(); |
| 100 | 100 | $formEvent->onPreSubmit($event); |
| 101 | 101 | } |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | $events = self::getEvents(); |
| 108 | 108 | |
| 109 | 109 | if (isset($events['onSubmit'])) { |
| 110 | - foreach($events['onSubmit'] as $formEventClass) { |
|
| 110 | + foreach ($events['onSubmit'] as $formEventClass) { |
|
| 111 | 111 | $formEvent = new $formEventClass(); |
| 112 | 112 | $formEvent->onSubmit($event); |
| 113 | 113 | } |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | $events = self::getEvents(); |
| 120 | 120 | |
| 121 | 121 | if (isset($events['onPostSubmit'])) { |
| 122 | - foreach($events['onPostSubmit'] as $formEventClass) { |
|
| 122 | + foreach ($events['onPostSubmit'] as $formEventClass) { |
|
| 123 | 123 | $formEvent = new $formEventClass(); |
| 124 | 124 | $formEvent->onPostSubmit($event); |
| 125 | 125 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | new Assert\Callback(array($this, 'validate')), |
| 97 | 97 | ), |
| 98 | 98 | )) |
| 99 | - ->addEventListener(FormEvents::POST_SUBMIT, function ($event) { |
|
| 99 | + ->addEventListener(FormEvents::POST_SUBMIT, function($event) { |
|
| 100 | 100 | $form = $event->getForm(); |
| 101 | 101 | $data = $form->getData(); |
| 102 | 102 | try { |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | $conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config); |
| 122 | 122 | $conn->connect(); |
| 123 | 123 | } catch (\Exception $e) { |
| 124 | - $form['database']->addError(new FormError('データベースに接続できませんでした。' . $e->getMessage())); |
|
| 124 | + $form['database']->addError(new FormError('データベースに接続できませんでした。'.$e->getMessage())); |
|
| 125 | 125 | } |
| 126 | 126 | }); |
| 127 | 127 | } |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | public function validate($data, ExecutionContext $context, $param = null) |
| 138 | 138 | { |
| 139 | 139 | $parameters = $this->app['request']->get('install_step4'); |
| 140 | - if ($parameters['database'] != 'pdo_sqlite'){ |
|
| 140 | + if ($parameters['database'] != 'pdo_sqlite') { |
|
| 141 | 141 | $context->validateValue($data, array( |
| 142 | 142 | new Assert\NotBlank() |
| 143 | 143 | )); |