Failed Conditions
Pull Request — master (#191)
by Emanuele
03:09
created
src/FacebookAds/Object/Traits/CannotUpdate.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,10 +24,8 @@
 block discarded – undo
24 24
 
25 25
 namespace FacebookAds\Object\Traits;
26 26
 
27
-trait CannotUpdate
28
-{
29
-    public function update(array $params = array())
30
-    {
27
+trait CannotUpdate {
28
+    public function update(array $params = array()) {
31 29
         throw new \Exception(
32 30
             __CLASS__.' does not have '.__FUNCTION__.' function.'
33 31
         );
Please login to merge, or discard this patch.
src/FacebookAds/Object/Traits/ObjectValidation.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,8 +27,7 @@  discard block
 block discarded – undo
27 27
 /**
28 28
  * @property array $changedFields
29 29
  */
30
-trait ObjectValidation
31
-{
30
+trait ObjectValidation {
32 31
     /**
33 32
      * @param array $params
34 33
      * @return $this
@@ -40,8 +39,7 @@  discard block
 block discarded – undo
40 39
      * @return $this
41 40
      * @throws \InvalidArgumentException
42 41
      */
43
-    public function validate(array $params = array())
44
-    {
42
+    public function validate(array $params = array()) {
45 43
         $changed_fields = $this->changedFields;
46 44
         $validate_flag = array(
47 45
             'execution_options' => array('validate_only')
Please login to merge, or discard this patch.
src/FacebookAds/Object/Traits/AdLabelAwareCrudObjectTrait.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -31,15 +31,13 @@  discard block
 block discarded – undo
31 31
  * @method Api getApi()
32 32
  * @method string assureId()
33 33
  */
34
-trait AdLabelAwareCrudObjectTrait
35
-{
34
+trait AdLabelAwareCrudObjectTrait {
36 35
     /**
37 36
      * Take ad label ids and format them correctly for the request
38 37
      * @param array $adlabel_ids
39 38
      * @return array
40 39
      */
41
-    protected function formatParams(array $adlabel_ids)
42
-    {
40
+    protected function formatParams(array $adlabel_ids) {
43 41
         foreach ($adlabel_ids as &$adlabel_id) {
44 42
             $adlabel_id = array('id' => $adlabel_id);
45 43
         }
@@ -50,8 +48,7 @@  discard block
 block discarded – undo
50 48
     /**
51 49
      * @param array $ad_label_ids
52 50
      */
53
-    public function addAdLabels(array $ad_label_ids)
54
-    {
51
+    public function addAdLabels(array $ad_label_ids) {
55 52
         $this->getApi()->call(
56 53
             '/'.$this->assureId().'/adlabels',
57 54
             RequestInterface::METHOD_POST,
@@ -62,8 +59,7 @@  discard block
 block discarded – undo
62 59
     /**
63 60
      * @param array $ad_label_ids
64 61
      */
65
-    public function removeAdLabels(array $ad_label_ids)
66
-    {
62
+    public function removeAdLabels(array $ad_label_ids) {
67 63
         $this->getApi()->call(
68 64
             '/'.$this->assureId().'/adlabels',
69 65
             RequestInterface::METHOD_DELETE,
Please login to merge, or discard this patch.
src/FacebookAds/Object/Traits/CannotDelete.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,10 +24,8 @@
 block discarded – undo
24 24
 
25 25
 namespace FacebookAds\Object\Traits;
26 26
 
27
-trait CannotDelete
28
-{
29
-    public function delete(array $params = array())
30
-    {
27
+trait CannotDelete {
28
+    public function delete(array $params = array()) {
31 29
         throw new \Exception(
32 30
             __CLASS__.' does not have '.__FUNCTION__.' function.'
33 31
         );
Please login to merge, or discard this patch.
src/FacebookAds/Object/Traits/FieldValidation.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,16 +29,14 @@
 block discarded – undo
29 29
 /**
30 30
  * @method static EnumInstanceInterface getFieldsEnum()
31 31
  */
32
-trait FieldValidation
33
-{
32
+trait FieldValidation {
34 33
     /**
35 34
      * @param string $name
36 35
      * @param mixed $value
37 36
      * @throws \InvalidArgumentException
38 37
      * @staticvar array $fields
39 38
      */
40
-    public function __set($name, $value)
41
-    {
39
+    public function __set($name, $value) {
42 40
         if (static::getFieldsEnum()->isValidValue($name)) {
43 41
             parent::__set($name, $value);
44 42
         } else {
Please login to merge, or discard this patch.
src/FacebookAds/Object/PartnerCategory.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -30,8 +30,7 @@  discard block
 block discarded – undo
30 30
 use FacebookAds\Object\Traits\CannotUpdate;
31 31
 use FacebookAds\Object\Traits\FieldValidation;
32 32
 
33
-class PartnerCategory extends AbstractCrudObject
34
-{
33
+class PartnerCategory extends AbstractCrudObject {
35 34
     use CannotCreate;
36 35
     use CannotDelete;
37 36
     use CannotUpdate;
@@ -40,16 +39,14 @@  discard block
 block discarded – undo
40 39
     /**
41 40
      * @return string
42 41
      */
43
-    protected function getEndpoint()
44
-    {
42
+    protected function getEndpoint() {
45 43
         return 'partnercategories';
46 44
     }
47 45
 
48 46
     /**
49 47
      * @return PartnerCategoryFields
50 48
      */
51
-    public static function getFieldsEnum()
52
-    {
49
+    public static function getFieldsEnum() {
53 50
         return PartnerCategoryFields::getInstance();
54 51
     }
55 52
 }
Please login to merge, or discard this patch.
src/FacebookAds/Object/ProductFeedUpload.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -30,24 +30,21 @@  discard block
 block discarded – undo
30 30
 use FacebookAds\Object\Traits\CannotDelete;
31 31
 use FacebookAds\Object\Traits\CannotUpdate;
32 32
 
33
-class ProductFeedUpload extends AbstractCrudObject
34
-{
33
+class ProductFeedUpload extends AbstractCrudObject {
35 34
     use CannotDelete;
36 35
     use CannotUpdate;
37 36
 
38 37
     /**
39 38
      * @return string
40 39
      */
41
-    protected function getEndpoint()
42
-    {
40
+    protected function getEndpoint() {
43 41
         return 'uploads';
44 42
     }
45 43
 
46 44
     /**
47 45
      * @return ProductFeedUploadFields
48 46
      */
49
-    public static function getFieldsEnum()
50
-    {
47
+    public static function getFieldsEnum() {
51 48
         return ProductFeedUploadFields::getInstance();
52 49
     }
53 50
 
@@ -56,8 +53,7 @@  discard block
 block discarded – undo
56 53
      * @param array $params
57 54
      * @return Cursor
58 55
      */
59
-    public function getErrors(array $fields = array(), array $params = array())
60
-    {
56
+    public function getErrors(array $fields = array(), array $params = array()) {
61 57
         return $this->getManyByConnection(
62 58
             ProductFeedUploadError::className(), $fields, $params);
63 59
     }
Please login to merge, or discard this patch.
src/FacebookAds/Object/AdUser.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -31,8 +31,7 @@  discard block
 block discarded – undo
31 31
 use FacebookAds\Object\Traits\CannotUpdate;
32 32
 use FacebookAds\Object\Traits\FieldValidation;
33 33
 
34
-class AdUser extends AbstractCrudObject
35
-{
34
+class AdUser extends AbstractCrudObject {
36 35
     use FieldValidation;
37 36
     use CannotDelete;
38 37
     use CannotCreate;
@@ -41,16 +40,14 @@  discard block
 block discarded – undo
41 40
     /**
42 41
      * @return string
43 42
      */
44
-    protected function getEndpoint()
45
-    {
43
+    protected function getEndpoint() {
46 44
         return 'users';
47 45
     }
48 46
 
49 47
     /**
50 48
      * @return AdUserFields
51 49
      */
52
-    public static function getFieldsEnum()
53
-    {
50
+    public static function getFieldsEnum() {
54 51
         return AdUserFields::getInstance();
55 52
     }
56 53
 
@@ -60,8 +57,7 @@  discard block
 block discarded – undo
60 57
      * @return Cursor
61 58
      */
62 59
     public function getAdAccounts(
63
-        array $fields = array(), array $params = array())
64
-    {
60
+        array $fields = array(), array $params = array()) {
65 61
         return $this->getManyByConnection(AdAccount::className(), $fields, $params);
66 62
     }
67 63
 
@@ -71,8 +67,7 @@  discard block
 block discarded – undo
71 67
      * @return Cursor
72 68
      */
73 69
     public function getAdAccountGroups(
74
-        array $fields = array(), array $params = array())
75
-    {
70
+        array $fields = array(), array $params = array()) {
76 71
         return $this->getManyByConnection(
77 72
             AdAccountGroup::className(),
78 73
             $fields,
Please login to merge, or discard this patch.
src/FacebookAds/Object/LeadgenForm.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -30,8 +30,7 @@  discard block
 block discarded – undo
30 30
 use FacebookAds\Object\Traits\CannotDelete;
31 31
 use FacebookAds\Object\Traits\CannotUpdate;
32 32
 
33
-class LeadgenForm extends AbstractCrudObject
34
-{
33
+class LeadgenForm extends AbstractCrudObject {
35 34
     use CannotCreate;
36 35
     use CannotUpdate;
37 36
     use CannotDelete;
@@ -39,16 +38,14 @@  discard block
 block discarded – undo
39 38
     /**
40 39
      * @return string
41 40
      */
42
-    protected function getEndpoint()
43
-    {
41
+    protected function getEndpoint() {
44 42
         return 'leadgen_forms';
45 43
     }
46 44
 
47 45
     /**
48 46
      * @return LeadgenFormFields
49 47
      */
50
-    public static function getFieldsEnum()
51
-    {
48
+    public static function getFieldsEnum() {
52 49
         return LeadgenFormFields::getInstance();
53 50
     }
54 51
 
@@ -58,8 +55,7 @@  discard block
 block discarded – undo
58 55
      * @return Cursor
59 56
      */
60 57
     public function getLeads(
61
-        array $fields = array(), array $params = array())
62
-    {
58
+        array $fields = array(), array $params = array()) {
63 59
         return $this->getManyByConnection(
64 60
             Lead::className(), $fields, $params);
65 61
     }
Please login to merge, or discard this patch.