Completed
Push — master ( e4db9d...bdef63 )
by Sam
04:28 queued 01:37
created
src/cli/Jalle19/StatusManager/Database/Base/ConnectionQuery.php 1 patch
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
      * $query->filterByStarted(array('max' => 'yesterday')); // WHERE started > '2011-03-13'
426 426
      * </code>
427 427
      *
428
-     * @param     mixed $started The value to use as filter.
428
+     * @param     integer $started The value to use as filter.
429 429
      *              Values can be integers (unix timestamps), DateTime objects, or strings.
430 430
      *              Empty strings are treated as NULL.
431 431
      *              Use scalar values for equality.
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
     /**
491 491
      * Filter the query by a related \Jalle19\StatusManager\Database\Instance object
492 492
      *
493
-     * @param \Jalle19\StatusManager\Database\Instance|ObjectCollection $instance The related object(s) to use as filter
493
+     * @param Instance $instance The related object(s) to use as filter
494 494
      * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
495 495
      *
496 496
      * @throws \Propel\Runtime\Exception\PropelException
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
     /**
568 568
      * Filter the query by a related \Jalle19\StatusManager\Database\User object
569 569
      *
570
-     * @param \Jalle19\StatusManager\Database\User|ObjectCollection $user The related object(s) to use as filter
570
+     * @param User $user The related object(s) to use as filter
571 571
      * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
572 572
      *
573 573
      * @throws \Propel\Runtime\Exception\PropelException
Please login to merge, or discard this patch.
src/cli/Jalle19/StatusManager/Database/Base/Instance.php 1 patch
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
      *
315 315
      * @param  string  $msg
316 316
      * @param  int     $priority One of the Propel::LOG_* logging levels
317
-     * @return boolean
317
+     * @return boolean|null
318 318
      */
319 319
     protected function log($msg, $priority = Propel::LOG_INFO)
320 320
     {
@@ -758,7 +758,7 @@  discard block
 block discarded – undo
758 758
      *                     one of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_CAMELNAME
759 759
      *                     TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
760 760
      *                     Defaults to TableMap::TYPE_PHPNAME.
761
-     * @return mixed Value of field.
761
+     * @return string|null Value of field.
762 762
      */
763 763
     public function getByName($name, $type = TableMap::TYPE_PHPNAME)
764 764
     {
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
      * Zero-based.
774 774
      *
775 775
      * @param      int $pos position in xml schema
776
-     * @return mixed Value of field at $pos
776
+     * @return string|null Value of field at $pos
777 777
      */
778 778
     public function getByPosition($pos)
779 779
     {
@@ -959,7 +959,7 @@  discard block
 block discarded – undo
959 959
      * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
960 960
      * The default key type is the column's TableMap::TYPE_PHPNAME.
961 961
      *
962
-     * @param mixed $parser A AbstractParser instance,
962
+     * @param string $parser A AbstractParser instance,
963 963
      *                       or a format name ('XML', 'YAML', 'JSON', 'CSV')
964 964
      * @param string $data The source data to import from
965 965
      * @param string $keyType The type of keys the array uses.
Please login to merge, or discard this patch.
src/cli/Jalle19/StatusManager/Database/Base/InstanceQuery.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -138,7 +138,7 @@
 block discarded – undo
138 138
      * $obj  = $c->findPk(12, $con);
139 139
      * </code>
140 140
      *
141
-     * @param mixed $key Primary key to use for the query
141
+     * @param string $key Primary key to use for the query
142 142
      * @param ConnectionInterface $con an optional connection object
143 143
      *
144 144
      * @return ChildInstance|array|mixed the result, formatted by the current formatter
Please login to merge, or discard this patch.
src/cli/Jalle19/StatusManager/Database/Base/SubscriptionQuery.php 1 patch
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
      * $query->filterBySubscriptionId(array('min' => 12)); // WHERE subscription_id > 12
465 465
      * </code>
466 466
      *
467
-     * @param     mixed $subscriptionId The value to use as filter.
467
+     * @param     integer $subscriptionId The value to use as filter.
468 468
      *              Use scalar values for equality.
469 469
      *              Use array values for in_array() equivalent.
470 470
      *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
      * $query->filterByStarted(array('max' => 'yesterday')); // WHERE started > '2011-03-13'
506 506
      * </code>
507 507
      *
508
-     * @param     mixed $started The value to use as filter.
508
+     * @param     integer $started The value to use as filter.
509 509
      *              Values can be integers (unix timestamps), DateTime objects, or strings.
510 510
      *              Empty strings are treated as NULL.
511 511
      *              Use scalar values for equality.
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
     /**
643 643
      * Filter the query by a related \Jalle19\StatusManager\Database\Instance object
644 644
      *
645
-     * @param \Jalle19\StatusManager\Database\Instance|ObjectCollection $instance The related object(s) to use as filter
645
+     * @param Instance $instance The related object(s) to use as filter
646 646
      * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
647 647
      *
648 648
      * @throws \Propel\Runtime\Exception\PropelException
@@ -719,7 +719,7 @@  discard block
 block discarded – undo
719 719
     /**
720 720
      * Filter the query by a related \Jalle19\StatusManager\Database\User object
721 721
      *
722
-     * @param \Jalle19\StatusManager\Database\User|ObjectCollection $user The related object(s) to use as filter
722
+     * @param User $user The related object(s) to use as filter
723 723
      * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
724 724
      *
725 725
      * @throws \Propel\Runtime\Exception\PropelException
@@ -796,7 +796,7 @@  discard block
 block discarded – undo
796 796
     /**
797 797
      * Filter the query by a related \Jalle19\StatusManager\Database\Channel object
798 798
      *
799
-     * @param \Jalle19\StatusManager\Database\Channel|ObjectCollection $channel The related object(s) to use as filter
799
+     * @param Channel $channel The related object(s) to use as filter
800 800
      * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
801 801
      *
802 802
      * @throws \Propel\Runtime\Exception\PropelException
Please login to merge, or discard this patch.
src/cli/Jalle19/StatusManager/Database/Base/User.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
      *
306 306
      * @param  string  $msg
307 307
      * @param  int     $priority One of the Propel::LOG_* logging levels
308
-     * @return boolean
308
+     * @return boolean|null
309 309
      */
310 310
     protected function log($msg, $priority = Propel::LOG_INFO)
311 311
     {
@@ -1028,7 +1028,7 @@  discard block
 block discarded – undo
1028 1028
      * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
1029 1029
      * The default key type is the column's TableMap::TYPE_PHPNAME.
1030 1030
      *
1031
-     * @param mixed $parser A AbstractParser instance,
1031
+     * @param string $parser A AbstractParser instance,
1032 1032
      *                       or a format name ('XML', 'YAML', 'JSON', 'CSV')
1033 1033
      * @param string $data The source data to import from
1034 1034
      * @param string $keyType The type of keys the array uses.
Please login to merge, or discard this patch.
src/cli/Jalle19/StatusManager/Database/Base/UserQuery.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -138,7 +138,7 @@
 block discarded – undo
138 138
      * $obj  = $c->findPk(12, $con);
139 139
      * </code>
140 140
      *
141
-     * @param mixed $key Primary key to use for the query
141
+     * @param integer $key Primary key to use for the query
142 142
      * @param ConnectionInterface $con an optional connection object
143 143
      *
144 144
      * @return ChildUser|array|mixed the result, formatted by the current formatter
Please login to merge, or discard this patch.
src/cli/Jalle19/StatusManager/PersistenceManager.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 
252 252
 
253 253
 	/**
254
-	 * @param                  $instanceName
254
+	 * @param                  string $instanceName
255 255
 	 * @param ConnectionStatus $connectionStatus
256 256
 	 *
257 257
 	 * @return bool whether the connection exists in the database
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 
291 291
 	/**
292 292
 	 * @param Database\Instance  $instance
293
-	 * @param                    $user
293
+	 * @param                    User $user
294 294
 	 * @param Channel            $channel
295 295
 	 * @param SubscriptionStatus $subscription
296 296
 	 *
Please login to merge, or discard this patch.
Braces   +21 added lines, -14 removed lines patch added patch discarded remove patch
@@ -50,8 +50,9 @@  discard block
 block discarded – undo
50 50
 	 */
51 51
 	public function onInstanceSeen(Tvheadend $instance)
52 52
 	{
53
-		if ($this->hasInstance($instance))
54
-			return;
53
+		if ($this->hasInstance($instance)) {
54
+					return;
55
+		}
55 56
 
56 57
 		$instanceModel = new Database\Instance();
57 58
 		$instanceModel->setPrimaryKey($instance->getHostname());
@@ -80,8 +81,9 @@  discard block
 block discarded – undo
80 81
 	 */
81 82
 	public function onConnectionSeen($instanceName, ConnectionStatus $connectionStatus)
82 83
 	{
83
-		if ($this->hasConnection($instanceName, $connectionStatus))
84
-			return;
84
+		if ($this->hasConnection($instanceName, $connectionStatus)) {
85
+					return;
86
+		}
85 87
 
86 88
 		$user = null;
87 89
 
@@ -114,8 +116,9 @@  discard block
 block discarded – undo
114 116
 	 */
115 117
 	public function onUserSeen($instanceName, $userName)
116 118
 	{
117
-		if ($this->hasUser($instanceName, $userName))
118
-			return;
119
+		if ($this->hasUser($instanceName, $userName)) {
120
+					return;
121
+		}
119 122
 
120 123
 		$user = new User();
121 124
 		$user->setInstanceName($instanceName)->setName($userName);
@@ -136,8 +139,9 @@  discard block
 block discarded – undo
136 139
 	 */
137 140
 	public function onChannelSeen($instanceName, $channelName)
138 141
 	{
139
-		if ($this->hasChannel($instanceName, $channelName))
140
-			return;
142
+		if ($this->hasChannel($instanceName, $channelName)) {
143
+					return;
144
+		}
141 145
 
142 146
 		$channel = new Channel();
143 147
 		$channel->setInstanceName($instanceName)->setName($channelName);
@@ -159,8 +163,9 @@  discard block
 block discarded – undo
159 163
 	public function onSubscriptionSeen($instanceName, SubscriptionStatus $status)
160 164
 	{
161 165
 		// Ignore EPG grabber subscriptions
162
-		if ($status->getType() === SubscriptionStatus::TYPE_EPGGRAB)
163
-			return;
166
+		if ($status->getType() === SubscriptionStatus::TYPE_EPGGRAB) {
167
+					return;
168
+		}
164 169
 
165 170
 		// Determine the username to store for the subscription
166 171
 		$username = $status->username;
@@ -180,8 +185,9 @@  discard block
 block discarded – undo
180 185
 		$this->onChannelSeen($instanceName, $status->channel);
181 186
 		$channel = ChannelQuery::create()->filterByInstance($instance)->filterByName($status->channel)->findOne();
182 187
 
183
-		if ($this->hasSubscription($instance, $user, $channel, $status))
184
-			return;
188
+		if ($this->hasSubscription($instance, $user, $channel, $status)) {
189
+					return;
190
+		}
185 191
 
186 192
 		$subscription = new Subscription();
187 193
 		$subscription->setInstance($instance)->setUser($user)->setChannel($channel)
@@ -205,8 +211,9 @@  discard block
 block discarded – undo
205 211
 	public function onSubscriptionStateChange($instanceName, StateChange $stateChange)
206 212
 	{
207 213
 		// We only need to persist subscription stops
208
-		if ($stateChange->getState() === StateChange::STATE_SUBSCRIPTION_STARTED)
209
-			return;
214
+		if ($stateChange->getState() === StateChange::STATE_SUBSCRIPTION_STARTED) {
215
+					return;
216
+		}
210 217
 
211 218
 		// Find the latest matching subscription
212 219
 		$subscription = SubscriptionQuery::create()->filterByInstanceName($instanceName)
Please login to merge, or discard this patch.
src/cli/Jalle19/StatusManager/Configuration.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -92,8 +92,9 @@  discard block
 block discarded – undo
92 92
 	 */
93 93
 	public function setUpdateInterval($updateInterval)
94 94
 	{
95
-		if ($updateInterval <= 0)
96
-			throw new \RuntimeException('Invalid update interval specified');
95
+		if ($updateInterval <= 0) {
96
+					throw new \RuntimeException('Invalid update interval specified');
97
+		}
97 98
 
98 99
 		$this->_updateInterval = $updateInterval;
99 100
 	}
@@ -133,8 +134,9 @@  discard block
 block discarded – undo
133 134
 	 */
134 135
 	public function setListenPort($listenPort)
135 136
 	{
136
-		if ($listenPort < 1 || $listenPort > 65535)
137
-			throw new \RuntimeException('Invalid port specified');
137
+		if ($listenPort < 1 || $listenPort > 65535) {
138
+					throw new \RuntimeException('Invalid port specified');
139
+		}
138 140
 
139 141
 		$this->_listenPort = $listenPort;
140 142
 	}
Please login to merge, or discard this patch.
Jalle19/StatusManager/Console/Commands/TvheadendStatusManagerCommand.php 1 patch
Braces   +20 added lines, -14 removed lines patch added patch discarded remove patch
@@ -124,23 +124,26 @@  discard block
 block discarded – undo
124 124
 	private function parseConfiguration(InputInterface $input)
125 125
 	{
126 126
 		// Check that the configuration file exists
127
-		if (!file_exists($input->getArgument('configFile')))
128
-			throw new InvalidConfigurationException('The specified configuration file does not exist');
127
+		if (!file_exists($input->getArgument('configFile'))) {
128
+					throw new InvalidConfigurationException('The specified configuration file does not exist');
129
+		}
129 130
 
130 131
 		// Check that the database exists and is writable
131 132
 		$databasePath = $input->getArgument('databaseFile');
132 133
 
133
-		if (!file_exists($databasePath))
134
-			throw new InvalidConfigurationException('The specified database path does not exist');
135
-		else if (!is_writable($databasePath))
136
-			throw new InvalidConfigurationException('The specified database path is not writable');
134
+		if (!file_exists($databasePath)) {
135
+					throw new InvalidConfigurationException('The specified database path does not exist');
136
+		} else if (!is_writable($databasePath)) {
137
+					throw new InvalidConfigurationException('The specified database path is not writable');
138
+		}
137 139
 
138 140
 		// Parse the configuration file
139 141
 		$configuration = parse_ini_file($input->getArgument('configFile'), true);
140 142
 
141 143
 		// Check that the file was parsed
142
-		if ($configuration === false)
143
-			throw new InvalidConfigurationException('Failed to parse the specified configuration file');
144
+		if ($configuration === false) {
145
+					throw new InvalidConfigurationException('Failed to parse the specified configuration file');
146
+		}
144 147
 
145 148
 		$instances    = [];
146 149
 
@@ -157,8 +160,9 @@  discard block
 block discarded – undo
157 160
 					$instance = new Instance($name, $address, $port);
158 161
 
159 162
 					// Optionally set credentials
160
-					if (isset($values['username']) && isset($values['password']))
161
-						$instance->setCredentials($values['username'], $values['password']);
163
+					if (isset($values['username']) && isset($values['password'])) {
164
+											$instance->setCredentials($values['username'], $values['password']);
165
+					}
162 166
 
163 167
 					$instances[] = $instance;
164 168
 					break;
@@ -166,8 +170,9 @@  discard block
 block discarded – undo
166 170
 		}
167 171
 
168 172
 		// Validate the configuration. We need at least one instance.
169
-		if (empty($instances))
170
-			throw new InvalidConfigurationException('No instances defined, you need to specify at least one instance');
173
+		if (empty($instances)) {
174
+					throw new InvalidConfigurationException('No instances defined, you need to specify at least one instance');
175
+		}
171 176
 
172 177
 		// Create the configuration object
173 178
 		$config = new Configuration($databasePath, $instances);
@@ -196,8 +201,9 @@  discard block
 block discarded – undo
196 201
 	 */
197 202
 	private static function getSectionType($section)
198 203
 	{
199
-		if (substr($section, 0, 8) === 'instance')
200
-			return Configuration::SECTION_TYPE_INSTANCE;
204
+		if (substr($section, 0, 8) === 'instance') {
205
+					return Configuration::SECTION_TYPE_INSTANCE;
206
+		}
201 207
 
202 208
 		throw new InvalidConfigurationException('Unknown section "' . $section . '"');
203 209
 	}
Please login to merge, or discard this patch.