VimeoDataObjectRedoTask   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 5
dl 0
loc 19
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 12 3
1
<?php
2
3
class VimeoDataObjectRedoTask extends BuildTask
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
4
{
5
    protected $title = "Redo meta-data for Vimeo Objects";
6
7
    protected $description = "Removes all the cached meta-data for all vimeo objects and re-applies them. Should end with the word Completed.";
8
9
    public function run($request)
10
    {
11
        $count = VimeoDataObject::get()->count() + 1;
12
        for ($i = 0; $i < $count; $i++) {
13
            $obj = VimeoDataObject::get()->limit(1, $i)->First();
14
            if ($obj) {
15
                DB::alteration_message("Saving data for object with code ".$obj->VimeoCode, "created");
16
                $obj->HTML(true);
17
            }
18
        }
19
        DB::alteration_message("================ COMPLETED ====================");
20
    }
21
}
22