@@ -70,11 +70,11 @@ discard block |
||
| 70 | 70 | $this->setYem($yem); |
| 71 | 71 | $data = $event->getData(); |
| 72 | 72 | $this->getYem() |
| 73 | - ->triggerLogEvent( |
|
| 74 | - 'Yapeal.Log.log', |
|
| 75 | - Logger::DEBUG, |
|
| 76 | - $this->getReceivedEventMessage($data, $eventName, __CLASS__) |
|
| 77 | - ); |
|
| 73 | + ->triggerLogEvent( |
|
| 74 | + 'Yapeal.Log.log', |
|
| 75 | + Logger::DEBUG, |
|
| 76 | + $this->getReceivedEventMessage($data, $eventName, __CLASS__) |
|
| 77 | + ); |
|
| 78 | 78 | $fileName = $this->findEveApiFile($data->getEveApiSectionName(), $data->getEveApiName(), 'xsd'); |
| 79 | 79 | if ('' === $fileName) { |
| 80 | 80 | return $event; |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | if (0 !== count($errors)) { |
| 92 | 92 | foreach ($errors as $error) { |
| 93 | 93 | $this->getYem() |
| 94 | - ->triggerLogEvent('Yapeal.Log.log', Logger::NOTICE, $error->message); |
|
| 94 | + ->triggerLogEvent('Yapeal.Log.log', Logger::NOTICE, $error->message); |
|
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | libxml_clear_errors(); |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | */ |
| 54 | 54 | public function __construct($dir = __DIR__) |
| 55 | 55 | { |
| 56 | - $this->setRelativeBaseDir($dir . '/'); |
|
| 56 | + $this->setRelativeBaseDir($dir.'/'); |
|
| 57 | 57 | } |
| 58 | 58 | /** |
| 59 | 59 | * @param EveApiEventInterface $event |
@@ -91,35 +91,35 @@ |
||
| 91 | 91 | $event = null; |
| 92 | 92 | foreach ($eventNames as $eventName) { |
| 93 | 93 | $this->getYem() |
| 94 | - ->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $this->getEmittingEventMessage($data, $eventName)); |
|
| 94 | + ->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $this->getEmittingEventMessage($data, $eventName)); |
|
| 95 | 95 | $event = $this->getYem() |
| 96 | - ->triggerEveApiEvent($eventName, $data); |
|
| 96 | + ->triggerEveApiEvent($eventName, $data); |
|
| 97 | 97 | $data = $event->getData(); |
| 98 | 98 | if ($event->hasBeenHandled()) { |
| 99 | 99 | $this->getYem() |
| 100 | - ->triggerLogEvent( |
|
| 101 | - 'Yapeal.Log.log', |
|
| 102 | - Logger::INFO, |
|
| 103 | - $this->getWasHandledEventMessage($data, $eventName) |
|
| 104 | - ); |
|
| 100 | + ->triggerLogEvent( |
|
| 101 | + 'Yapeal.Log.log', |
|
| 102 | + Logger::INFO, |
|
| 103 | + $this->getWasHandledEventMessage($data, $eventName) |
|
| 104 | + ); |
|
| 105 | 105 | break; |
| 106 | 106 | } |
| 107 | 107 | if ($event->isSufficientlyHandled()) { |
| 108 | 108 | $this->getYem() |
| 109 | - ->triggerLogEvent( |
|
| 110 | - 'Yapeal.Log.log', |
|
| 111 | - Logger::INFO, |
|
| 112 | - $this->getSufficientlyHandledEventMessage($data, $eventName) |
|
| 113 | - ); |
|
| 109 | + ->triggerLogEvent( |
|
| 110 | + 'Yapeal.Log.log', |
|
| 111 | + Logger::INFO, |
|
| 112 | + $this->getSufficientlyHandledEventMessage($data, $eventName) |
|
| 113 | + ); |
|
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | 116 | if (null === $event || !$event->isSufficientlyHandled()) { |
| 117 | 117 | $this->getYem() |
| 118 | - ->triggerLogEvent( |
|
| 119 | - 'Yapeal.Log.log', |
|
| 120 | - Logger::NOTICE, |
|
| 121 | - $this->getNonHandledEventMessage($data, $eventSuffix) |
|
| 122 | - ); |
|
| 118 | + ->triggerLogEvent( |
|
| 119 | + 'Yapeal.Log.log', |
|
| 120 | + Logger::NOTICE, |
|
| 121 | + $this->getNonHandledEventMessage($data, $eventSuffix) |
|
| 122 | + ); |
|
| 123 | 123 | return false; |
| 124 | 124 | } |
| 125 | 125 | return true; |
@@ -59,11 +59,11 @@ discard block |
||
| 59 | 59 | $this->setYem($yem); |
| 60 | 60 | $data = $event->getData(); |
| 61 | 61 | $this->getYem() |
| 62 | - ->triggerLogEvent( |
|
| 63 | - 'Yapeal.Log.log', |
|
| 64 | - Logger::DEBUG, |
|
| 65 | - $this->getReceivedEventMessage($data, $eventName, __CLASS__) |
|
| 66 | - ); |
|
| 62 | + ->triggerLogEvent( |
|
| 63 | + 'Yapeal.Log.log', |
|
| 64 | + Logger::DEBUG, |
|
| 65 | + $this->getReceivedEventMessage($data, $eventName, __CLASS__) |
|
| 66 | + ); |
|
| 67 | 67 | $simple = new \SimpleXMLElement($data->getEveApiXml()); |
| 68 | 68 | /** @noinspection PhpUndefinedFieldInspection */ |
| 69 | 69 | $errorText = (string)$simple->error[0]; |
@@ -102,6 +102,6 @@ discard block |
||
| 102 | 102 | $this->emitEvents($data, 'cache'); |
| 103 | 103 | $data->setEveApiName($apiName); |
| 104 | 104 | return $event->setData($data) |
| 105 | - ->setHandledSufficiently(); |
|
| 105 | + ->setHandledSufficiently(); |
|
| 106 | 106 | } |
| 107 | 107 | } |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | } |
| 81 | 81 | if ($code < 200) { |
| 82 | 82 | if (false !== strpos($mess, 'retry after')) { |
| 83 | - $data->setCacheInterval(strtotime(substr($mess, -19) . '+00:00') - time()); |
|
| 83 | + $data->setCacheInterval(strtotime(substr($mess, -19).'+00:00') - time()); |
|
| 84 | 84 | } |
| 85 | 85 | $yem->triggerLogEvent('Yapeal.Log.log', Logger::WARNING, |
| 86 | 86 | $this->createEventMessage($mess, $data, $eventName)); |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $data->setCacheInterval(300); |
| 98 | 98 | } |
| 99 | 99 | $apiName = $data->getEveApiName(); |
| 100 | - $data->setEveApiName('Error_' . $apiName); |
|
| 100 | + $data->setEveApiName('Error_'.$apiName); |
|
| 101 | 101 | // Cache error XML. |
| 102 | 102 | $this->emitEvents($data, 'cache'); |
| 103 | 103 | $data->setEveApiName($apiName); |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | { |
| 52 | 52 | if (empty($dic['Yapeal.Xsl.Transformer'])) { |
| 53 | 53 | $dic['Yapeal.Xsl.Transformer'] = $dic->factory( |
| 54 | - function ($dic) { |
|
| 54 | + function($dic) { |
|
| 55 | 55 | return new $dic['Yapeal.Xsl.transform']($dic['Yapeal.Xsl.dir']); |
| 56 | 56 | } |
| 57 | 57 | ); |
@@ -51,14 +51,14 @@ |
||
| 51 | 51 | { |
| 52 | 52 | if (empty($dic['Yapeal.Xml.Data'])) { |
| 53 | 53 | $dic['Yapeal.Xml.Data'] = $dic->factory( |
| 54 | - function ($dic) { |
|
| 54 | + function($dic) { |
|
| 55 | 55 | return new $dic['Yapeal.Xml.data'](); |
| 56 | 56 | } |
| 57 | 57 | ); |
| 58 | 58 | } |
| 59 | 59 | if (empty($dic['Yapeal.Xml.Error.Subscriber'])) { |
| 60 | 60 | $dic['Yapeal.Xml.Error.Subscriber'] = $dic->factory( |
| 61 | - function ($dic) { |
|
| 61 | + function($dic) { |
|
| 62 | 62 | return new $dic['Yapeal.Xml.Handlers.error'](); |
| 63 | 63 | } |
| 64 | 64 | ); |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | public function wire(ContainerInterface $dic) |
| 56 | 56 | { |
| 57 | 57 | if (empty($dic['Yapeal.Sql.CommonQueries'])) { |
| 58 | - $dic['Yapeal.Sql.CommonQueries'] = function ($dic) { |
|
| 58 | + $dic['Yapeal.Sql.CommonQueries'] = function($dic) { |
|
| 59 | 59 | return new $dic['Yapeal.Sql.sharedSql']( |
| 60 | 60 | $dic['Yapeal.Sql.database'], $dic['Yapeal.Sql.tablePrefix'] |
| 61 | 61 | ); |
@@ -65,13 +65,13 @@ discard block |
||
| 65 | 65 | return $this; |
| 66 | 66 | } |
| 67 | 67 | if ('mysql' !== $dic['Yapeal.Sql.platform']) { |
| 68 | - $mess = 'Unknown platform, was given ' . $dic['Yapeal.Sql.platform']; |
|
| 68 | + $mess = 'Unknown platform, was given '.$dic['Yapeal.Sql.platform']; |
|
| 69 | 69 | throw new YapealDatabaseException($mess); |
| 70 | 70 | } |
| 71 | - $dic['Yapeal.Sql.Connection'] = function ($dic) { |
|
| 72 | - $dsn = $dic['Yapeal.Sql.platform'] . ':host=' . $dic['Yapeal.Sql.hostName'] . ';charset=utf8'; |
|
| 71 | + $dic['Yapeal.Sql.Connection'] = function($dic) { |
|
| 72 | + $dsn = $dic['Yapeal.Sql.platform'].':host='.$dic['Yapeal.Sql.hostName'].';charset=utf8'; |
|
| 73 | 73 | if (!empty($dic['Yapeal.Sql.port'])) { |
| 74 | - $dsn .= ';port=' . $dic['Yapeal.Sql.port']; |
|
| 74 | + $dsn .= ';port='.$dic['Yapeal.Sql.port']; |
|
| 75 | 75 | } |
| 76 | 76 | /** |
| 77 | 77 | * @var PDO $database |
@@ -88,24 +88,24 @@ discard block |
||
| 88 | 88 | $database->exec('SET SESSION TIME_ZONE=\'+00:00\''); |
| 89 | 89 | $database->exec('SET NAMES utf8mb4 COLLATE utf8mb4_unicode_520_ci'); |
| 90 | 90 | $database->exec('SET COLLATION_CONNECTION=utf8mb4_unicode_520_ci'); |
| 91 | - $database->exec('SET DEFAULT_STORAGE_ENGINE=' . $dic['Yapeal.Sql.engine']); |
|
| 91 | + $database->exec('SET DEFAULT_STORAGE_ENGINE='.$dic['Yapeal.Sql.engine']); |
|
| 92 | 92 | return $database; |
| 93 | 93 | }; |
| 94 | 94 | if (empty($dic['Yapeal.Sql.Creator'])) { |
| 95 | 95 | $dic['Yapeal.Sql.Creator'] = $dic->factory( |
| 96 | - function ($dic) { |
|
| 96 | + function($dic) { |
|
| 97 | 97 | $loader = new Twig_Loader_Filesystem($dic['Yapeal.Sql.dir']); |
| 98 | 98 | $twig = new Twig_Environment( |
| 99 | 99 | $loader, ['debug' => true, 'strict_variables' => true, 'autoescape' => false] |
| 100 | 100 | ); |
| 101 | 101 | $filter = new Twig_SimpleFilter( |
| 102 | - 'ucFirst', function ($value) { |
|
| 102 | + 'ucFirst', function($value) { |
|
| 103 | 103 | return ucfirst($value); |
| 104 | 104 | } |
| 105 | 105 | ); |
| 106 | 106 | $twig->addFilter($filter); |
| 107 | 107 | $filter = new Twig_SimpleFilter( |
| 108 | - 'lcFirst', function ($value) { |
|
| 108 | + 'lcFirst', function($value) { |
|
| 109 | 109 | return lcfirst($value); |
| 110 | 110 | } |
| 111 | 111 | ); |
@@ -50,12 +50,12 @@ |
||
| 50 | 50 | { |
| 51 | 51 | if ('none' !== $dic['Yapeal.Cache.fileSystemMode']) { |
| 52 | 52 | if (empty($dic['Yapeal.FileSystem.CachePreserver'])) { |
| 53 | - $dic['Yapeal.FileSystem.CachePreserver'] = function () use ($dic) { |
|
| 53 | + $dic['Yapeal.FileSystem.CachePreserver'] = function() use ($dic) { |
|
| 54 | 54 | return new $dic['Yapeal.Cache.Handlers.preserve']($dic['Yapeal.Cache.dir']); |
| 55 | 55 | }; |
| 56 | 56 | } |
| 57 | 57 | if (empty($dic['Yapeal.FileSystem.CacheRetriever'])) { |
| 58 | - $dic['Yapeal.FileSystem.CacheRetriever'] = function () use ($dic) { |
|
| 58 | + $dic['Yapeal.FileSystem.CacheRetriever'] = function() use ($dic) { |
|
| 59 | 59 | return new $dic['Yapeal.Cache.Handlers.retrieve']($dic['Yapeal.Cache.dir']); |
| 60 | 60 | }; |
| 61 | 61 | } |
@@ -50,20 +50,20 @@ |
||
| 50 | 50 | { |
| 51 | 51 | if (empty($dic['Yapeal.Event.EveApiEvent'])) { |
| 52 | 52 | $dic['Yapeal.Event.EveApi'] = $dic->factory( |
| 53 | - function ($dic) { |
|
| 53 | + function($dic) { |
|
| 54 | 54 | return new $dic['Yapeal.Event.Factories.eveApi'](); |
| 55 | 55 | } |
| 56 | 56 | ); |
| 57 | 57 | } |
| 58 | 58 | if (empty($dic['Yapeal.Event.LogEvent'])) { |
| 59 | 59 | $dic['Yapeal.Event.LogEvent'] = $dic->factory( |
| 60 | - function ($dic) { |
|
| 60 | + function($dic) { |
|
| 61 | 61 | return new $dic['Yapeal.Event.Factories.log']; |
| 62 | 62 | } |
| 63 | 63 | ); |
| 64 | 64 | } |
| 65 | 65 | if (empty($dic['Yapeal.Event.Mediator'])) { |
| 66 | - $dic['Yapeal.Event.Mediator'] = function ($dic) { |
|
| 66 | + $dic['Yapeal.Event.Mediator'] = function($dic) { |
|
| 67 | 67 | return new $dic['Yapeal.Event.mediator']($dic); |
| 68 | 68 | }; |
| 69 | 69 | } |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | public function wire(ContainerInterface $dic) |
| 51 | 51 | { |
| 52 | 52 | if (empty($dic['Yapeal.Network.Client'])) { |
| 53 | - $dic['Yapeal.Network.Client'] = function ($dic) { |
|
| 53 | + $dic['Yapeal.Network.Client'] = function($dic) { |
|
| 54 | 54 | $appComment = $dic['Yapeal.Network.appComment']; |
| 55 | 55 | $appName = $dic['Yapeal.Network.appName']; |
| 56 | 56 | $appVersion = $dic['Yapeal.Network.appVersion']; |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | 'Keep-Alive' => $dic['Yapeal.Network.Headers.Keep-Alive'] |
| 87 | 87 | ]; |
| 88 | 88 | // Clean up any extra spaces and EOL chars from Yaml. |
| 89 | - array_walk($headers, function (&$value) { |
|
| 89 | + array_walk($headers, function(&$value) { |
|
| 90 | 90 | /** @noinspection ReferenceMismatchInspection */ |
| 91 | 91 | return trim(str_replace(' ', '', $value)); |
| 92 | 92 | }); |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | }; |
| 105 | 105 | } |
| 106 | 106 | if (empty($dic['Yapeal.Network.Retriever'])) { |
| 107 | - $dic['Yapeal.Network.Retriever'] = function ($dic) { |
|
| 107 | + $dic['Yapeal.Network.Retriever'] = function($dic) { |
|
| 108 | 108 | return new GuzzleNetworkRetriever($dic['Yapeal.Network.Client']); |
| 109 | 109 | }; |
| 110 | 110 | } |