]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/RegisterThrottle/RegisterThrottlePlugin.php
Added a lot more type-hints where they will happen. Please note that I found
[quix0rs-gnu-social.git] / plugins / RegisterThrottle / RegisterThrottlePlugin.php
index 251a2b4c7967207104f0bc5357f132d65bc9af83..d09642a6330872d0206d5a00406674c87ae4a3ee 100644 (file)
@@ -91,7 +91,7 @@ class RegisterThrottlePlugin extends Plugin
      *
      * @return boolean hook value
      */
-    public function onStartRegistrationTry($action)
+    public function onStartRegistrationTry(Action $action)
     {
         $ipaddress = $this->_getIpAddress();
 
@@ -156,10 +156,11 @@ class RegisterThrottlePlugin extends Plugin
 
         $reg->user_id   = $profile->id;
         $reg->ipaddress = $ipaddress;
+        $reg->created   = common_sql_now();
 
         $result = $reg->insert();
 
-        if (!$result) {
+        if ($result === false) {
             common_log_db_error($reg, 'INSERT', __FILE__);
             // @todo throw an exception?
         }
@@ -174,7 +175,7 @@ class RegisterThrottlePlugin extends Plugin
      *
      * @return boolean hook value
      */
-    public function onPluginVersion(&$versions)
+    public function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'RegisterThrottle',
                             'version' => GNUSOCIAL_VERSION,
@@ -240,7 +241,7 @@ class RegisterThrottlePlugin extends Plugin
      *
      * @return boolean hook value
      */
-    public function onEndGrantRole($profile, $role)
+    public function onEndGrantRole(Profile $profile, $role)
     {
         if (!self::$enabled) {
             return true;