Skip to content

Commit

Permalink
use 2 spaces indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
yalesov committed Jul 6, 2016
1 parent 64a29bd commit a1b05f5
Show file tree
Hide file tree
Showing 6 changed files with 368 additions and 368 deletions.
52 changes: 26 additions & 26 deletions README.md
Expand Up @@ -8,9 +8,9 @@ A collection of Phing Tasks.

```json
{
"require": {
"yalesov/phing-task": "2.*"
}
"require": {
"yalesov/phing-task": "2.*"
}
}
```

Expand All @@ -20,9 +20,9 @@ You can install it through Composer and use the CLI at `vendor/bin/phing`:

```json
{
"require": {
"phing/phing": "*"
}
"require": {
"phing/phing": "*"
}
}
```

Expand All @@ -41,11 +41,11 @@ Generate a classmap for the directory `foo/library` (and its subdirectories), sa

```xml
<project>
<target>
<includepath classpath="vendor/yalesov/phing-task/src/task" />
<taskdef name="classmap" classname="ClassmapTask" />
<classmap dir="foo/library" output="foo/autoload_classmap.php" />
</target>
<target>
<includepath classpath="vendor/yalesov/phing-task/src/task" />
<taskdef name="classmap" classname="ClassmapTask" />
<classmap dir="foo/library" output="foo/autoload_classmap.php" />
</target>
</project>
```

Expand All @@ -55,11 +55,11 @@ Clear the classmap file `foo/autoload_classmap.php`, i.e. set it to `return arra

```xml
<project>
<target>
<includepath classpath="vendor/yalesov/phing-task/src/task" />
<taskdef name="classmap-clear" classname="ClassmapClearTask" />
<classmap-clear file="foo/autoload_classmap.php" />
</target>
<target>
<includepath classpath="vendor/yalesov/phing-task/src/task" />
<taskdef name="classmap-clear" classname="ClassmapClearTask" />
<classmap-clear file="foo/autoload_classmap.php" />
</target>
</project>
```

Expand All @@ -69,11 +69,11 @@ Recursively [chown](http://php.net/manual/en/function.chown.php) the directory `

```xml
<project>
<target>
<includepath classpath="vendor/yalesov/phing-task/src/task" />
<taskdef name="rchown" classname="RchownTask" />
<rchown file="foo/src" user="foouser.foogroup" />
</target>
<target>
<includepath classpath="vendor/yalesov/phing-task/src/task" />
<taskdef name="rchown" classname="RchownTask" />
<rchown file="foo/src" user="foouser.foogroup" />
</target>
</project>
```

Expand All @@ -83,10 +83,10 @@ Recursively [rmdir](http://php.net/manual/en/function.rmdir.php) the directory `

```xml
<project>
<target>
<includepath classpath="vendor/yalesov/phing-task/src/task" />
<taskdef name="rrmdir" classname="RrmdirTask" />
<rrmdir file="foo/src" />
</target>
<target>
<includepath classpath="vendor/yalesov/phing-task/src/task" />
<taskdef name="rrmdir" classname="RrmdirTask" />
<rrmdir file="foo/src" />
</target>
</project>
```
60 changes: 30 additions & 30 deletions composer.json
@@ -1,33 +1,33 @@
{
"name": "yalesov/phing-task",
"description": "A collection of Phing Tasks.",
"keywords": ["phing"],
"authors": [
{
"name": "Yulij Andreevich Lesov",
"email": "yalesov@gmail.com"
}
],
"require": {
"php": ">=5.3.3",
"zendframework/zend-file": "2.*",
"yalesov/file-system-manager": "2.*"
},
"require-dev": {
"phpunit/phpunit": "*"
},
"autoload": {
"classmap": ["src/task/"]
},
"license": "ISC",
"homepage": "https://github.com/yalesov/php-phing-task",
"repositories": [
{
"type": "vcs",
"url": "https://github.com/yalesov/php-phing-task"
}
],
"support": {
"issues": "https://github.com/yalesov/php-phing-task/issues"
"name": "yalesov/phing-task",
"description": "A collection of Phing Tasks.",
"keywords": ["phing"],
"authors": [
{
"name": "Yulij Andreevich Lesov",
"email": "yalesov@gmail.com"
}
],
"require": {
"php": ">=5.3.3",
"zendframework/zend-file": "2.*",
"yalesov/file-system-manager": "2.*"
},
"require-dev": {
"phpunit/phpunit": "*"
},
"autoload": {
"classmap": ["src/task/"]
},
"license": "ISC",
"homepage": "https://github.com/yalesov/php-phing-task",
"repositories": [
{
"type": "vcs",
"url": "https://github.com/yalesov/php-phing-task"
}
],
"support": {
"issues": "https://github.com/yalesov/php-phing-task/issues"
}
}
112 changes: 56 additions & 56 deletions src/task/ClassmapClearTask.php
Expand Up @@ -3,60 +3,60 @@

class ClassmapClearTask extends Task
{
protected $file;
protected $failonerror = false;

/**
* classmap file
*
* @param string $file
* @return void
*/
public function setFile($file)
{
touch($file);
$this->file = realpath($file);
}

/**
* if error occured, whether build should fail
*
* @param bool $value
* @return void
*/
public function setFailonerror($value)
{
$this->failonerror = $value;
}

/**
* init
*
* @return void
*/
public function init()
{
}

/**
* main method
*
* @return void
*/
public function main()
{
$this->log(sprintf('Clearing classmap file %s', $this->file));

// Create a file with the class/file map.
// Stupid syntax highlighters make separating < from PHP declaration necessary
$content = '<' . "?php\n"
. "// Auto-generated by Phing, using ZF2's classmap generator\n"
. '// Generation time: ' . date(DATE_RFC2822) . "\n"
. 'return array();';

// Write the contents to disk
file_put_contents($this->file, $content);

$this->log(sprintf('Cleared classmap file at %s', $this->file));
}
protected $file;
protected $failonerror = false;

/**
* classmap file
*
* @param string $file
* @return void
*/
public function setFile($file)
{
touch($file);
$this->file = realpath($file);
}

/**
* if error occured, whether build should fail
*
* @param bool $value
* @return void
*/
public function setFailonerror($value)
{
$this->failonerror = $value;
}

/**
* init
*
* @return void
*/
public function init()
{
}

/**
* main method
*
* @return void
*/
public function main()
{
$this->log(sprintf('Clearing classmap file %s', $this->file));

// Create a file with the class/file map.
// Stupid syntax highlighters make separating < from PHP declaration necessary
$content = '<' . "?php\n"
. "// Auto-generated by Phing, using ZF2's classmap generator\n"
. '// Generation time: ' . date(DATE_RFC2822) . "\n"
. 'return array();';

// Write the contents to disk
file_put_contents($this->file, $content);

$this->log(sprintf('Cleared classmap file at %s', $this->file));
}
}

0 comments on commit a1b05f5

Please sign in to comment.