GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 72699b...b8e5ff )
by
unknown
09:37
created

PackedScriptCreator   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 88.24%

Importance

Changes 0
Metric Value
dl 0
loc 35
rs 10
c 0
b 0
f 0
ccs 15
cts 17
cp 0.8824
wmc 6
lcom 0
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 17 3
A delete() 0 8 3
1
<?php
2
3
/**
4
 * @author Nikita Melnikov <[email protected]>
5
 * @link https://github.com/shogodev/argilla/
6
 * @copyright Copyright &copy; 2003-2014 Shogo
7
 * @license http://argilla.ru/LICENSE
8
 * @package ext.mainscript
9
 */
10
class PackedScriptCreator extends ScriptAbstractCreator
11
{
12
  /**
13
   * Создание запакованного скрипта, собираемого из файлов ScriptsFileFinder::$files
14
   */
15 2
  public function create()
16
  {
17 2
    foreach($this->getScriptList() as $script)
18
    {
19 2
      $packed = fopen($script, 'a');
20
21 2
      foreach( ScriptsFileFinder::getInstance()->getFiles() as $file )
22
      {
23
        fwrite($packed, file_get_contents($file));
24
        fwrite($packed, "\n");
25 2
      }
26
27 2
      fclose($packed);
28
29 2
      chmod($script, 0664);
30 2
    }
31 2
  }
32
33
  /**
34
   * Удаление файла скрипта
35
   */
36 2
  public function delete()
37
  {
38 2
    foreach($this->getScriptList() as $packedFile)
39
    {
40 2
      if( file_exists($packedFile) )
41 2
        unlink($packedFile);
42 2
    }
43 2
  }
44
}
45