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::create()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 17
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 3.054

Importance

Changes 0
Metric Value
cc 3
eloc 8
nc 3
nop 0
dl 0
loc 17
rs 9.4285
c 0
b 0
f 0
ccs 9
cts 11
cp 0.8182
crap 3.054
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