Skip to content

Commit

Permalink
Nerds & Company
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob Olde Hampsink committed Nov 3, 2015
1 parent f6d6644 commit f4d4441
Show file tree
Hide file tree
Showing 18 changed files with 249 additions and 189 deletions.
10 changes: 5 additions & 5 deletions SchematicPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
*
* Sync Craft Setups.
*
* @author Itmundi
* @copyright Copyright (c) 2015, Itmundi
* @author Nerds & Company
* @copyright Copyright (c) 2015, Nerds & Company
* @license MIT
*
* @link http://www.itmundi.nl
* @link http://www.nerds.company
*/
class SchematicPlugin extends BasePlugin
{
Expand Down Expand Up @@ -42,7 +42,7 @@ public function getVersion()
*/
public function getDeveloper()
{
return 'Itmundi';
return 'Nerds & Company';
}

/**
Expand All @@ -52,6 +52,6 @@ public function getDeveloper()
*/
public function getDeveloperUrl()
{
return 'http://www.itmundi.nl';
return 'http://www.nerds.company';
}
}
30 changes: 21 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,39 @@
"description": "Sync Craft setups",
"authors": [
{
"name": "Bart van Gennepg",
"email": "b.vangennep@itmundi.nl",
"homepage": "http://www.itmundi.nl",
"name": "Bart van Gennep",
"email": "b.vangennep@nerds.company",
"homepage": "http://www.nerds.company",
"role": "Developer"
},
{
"name": "Bob Olde Hampsink",
"email": "b.oldehampsink@itmundi.nl",
"homepage": "http://www.itmundi.nl",
"email": "b.oldehampsink@nerds.company",
"homepage": "http://www.nerds.company",
"role": "Developer"
},
{
"name": "Gijs Stegehuis",
"email": "g.stegehuis@itmundi.nl",
"homepage": "http://www.itmundi.nl",
"email": "g.stegehuis@nerds.company",
"homepage": "http://www.nerds.company",
"role": "Developer"
},
{
"name": "Nick Obermeijer",
"email": "[email protected]",
"homepage": "http://www.itmundi.nl",
"email": "[email protected]",
"homepage": "http://www.nerds.company",
"role": "Developer"
},
{
"name": "Arjan Kleene",
"email": "[email protected]",
"homepage": "http://www.nerds.company",
"role": "Developer"
},
{
"name": "Niek Schmoller",
"email": "[email protected]",
"homepage": "http://www.nerds.company",
"role": "Developer"
}
],
Expand Down
12 changes: 6 additions & 6 deletions consolecommands/SchematicCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@
*
* Sync Craft Setups.
*
* @author Itmundi
* @copyright Copyright (c) 2015, Itmundi
* @author Nerds & Company
* @copyright Copyright (c) 2015, Nerds & Company
* @license MIT
*
* @link http://www.itmundi.nl
* @link http://www.nerds.company
*/
class SchematicCommand extends BaseCommand
{
/**
* Imports the Craft datamodel.
*
* @param string $file yml file containing the schema definition
* @param string $override_file yml file containing the override values
* @param bool $force if set to true items not in the import will be deleted
* @param string $file yml file containing the schema definition
* @param string $override_file yml file containing the override values
* @param bool $force if set to true items not in the import will be deleted
*/
public function actionImport($file = 'craft/config/schema.yml', $override_file = 'craft/config/override.yml', $force = false)
{
Expand Down
14 changes: 8 additions & 6 deletions models/Schematic_DataModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
*
* Encapsulates data that has been exported via schematic.
*
* @author Itmundi
* @copyright Copyright (c) 2015, Itmundi
* @author Nerds & Company
* @copyright Copyright (c) 2015, Nerds & Company
* @license MIT
*
* @link http://www.itmundi.nl
* @link http://www.nerds.company
*/
class Schematic_DataModel extends BaseModel
{
Expand Down Expand Up @@ -72,12 +72,14 @@ public static function toYaml(array $data)
}

/**
* @param string $attribute
* @param string $attribute
* @param bool|false $flattenValue
* @param array $default
* @param array $default
*
* @return array
*/
public function getAttribute($attribute, $flattenValue = false, $default = array()) {
public function getAttribute($attribute, $flattenValue = false, $default = array())
{
$attribute = parent::getAttribute($attribute, $flattenValue);

return (!is_null($attribute) ? $attribute : $default);
Expand Down
6 changes: 3 additions & 3 deletions models/Schematic_ResultModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
*
* Encapsulates the result of an action, including error messages.
*
* @author Itmundi
* @copyright Copyright (c) 2015, Itmundi
* @author Nerds & Company
* @copyright Copyright (c) 2015, Nerds & Company
* @license MIT
*
* @link http://www.itmundi.nl
* @link http://www.nerds.company
*/
class Schematic_ResultModel extends BaseModel
{
Expand Down
37 changes: 24 additions & 13 deletions services/SchematicService.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,24 @@
*
* Sync Craft Setups.
*
* @author Itmundi
* @copyright Copyright (c) 2015, Itmundi
* @author Nerds & Company
* @copyright Copyright (c) 2015, Nerds & Company
* @license MIT
*
* @link http://www.itmundi.nl
* @link http://www.nerds.company
*/
class SchematicService extends BaseApplicationComponent
{
const SCHEMATIC_METHOD_IMPORT = 'import';
const SCHEMATIC_METHOD_EXPORT = 'export';

/**
* Returns data from import model or default
* @param array $data
* Returns data from import model or default.
*
* @param array $data
* @param string $handle
* @param array $default
* @param array $default
*
* @return array
*/
private function getPluginData(array $data, $handle, array $default = array())
Expand All @@ -32,9 +34,11 @@ private function getPluginData(array $data, $handle, array $default = array())

/**
* Import from Yaml file.
*
* @param string $file
* @param string $override
* @param bool $force if set to true items not included in import will be deleted
* @param bool $force if set to true items not included in import will be deleted
*
* @return Schematic_ResultModel
*/
public function importFromYaml($file, $override = null, $force = false)
Expand All @@ -48,8 +52,10 @@ public function importFromYaml($file, $override = null, $force = false)

/**
* Export to Yaml file.
*
* @param string $file
* @param bool $autoCreate
* @param bool $autoCreate
*
* @return Schematic_ResultModel
*/
public function exportToYaml($file, $autoCreate = true)
Expand All @@ -67,8 +73,10 @@ public function exportToYaml($file, $autoCreate = true)

/**
* Import data model.
*
* @param Schematic_DataModel $model
* @param bool $force if set to true items not in the import will be deleted
*
* @return Schematic_ResultModel
*/
private function importDataModel(Schematic_DataModel $model, $force)
Expand Down Expand Up @@ -99,13 +107,15 @@ private function importDataModel(Schematic_DataModel $model, $force)
}

/**
* Handles importing
* @param Schematic_ResultModel $result
* @param array $data
* Handles importing.
*
* @param Schematic_ResultModel $result
* @param array $data
* @param array|Schematic_AbstractService[] $services
* @param $force
*/
private function doImport(Schematic_ResultModel $result, array $data, $services, $force) {
private function doImport(Schematic_ResultModel $result, array $data, $services, $force)
{
foreach ($services as $handle => $service) {
if (is_array($service)) {
$this->doImport($result, $data, $service, $force);
Expand Down Expand Up @@ -147,7 +157,8 @@ private function exportDataModel()
}

/**
* Handles exporting
* Handles exporting.
*
* @param array $services
* @param array $data
*/
Expand Down
6 changes: 3 additions & 3 deletions services/Schematic_AbstractService.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
/**
* Schematic Base Service for some easy access methods.
*
* @author Itmundi
* @copyright Copyright (c) 2015, Itmundi
* @author Nerds & Company
* @copyright Copyright (c) 2015, Nerds & Company
* @license MIT
*
* @link http://www.itmundi.nl
* @link http://www.nerds.company
*/
abstract class Schematic_AbstractService extends BaseApplicationComponent
{
Expand Down
6 changes: 3 additions & 3 deletions services/Schematic_AssetsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
*
* Sync Craft Setups.
*
* @author Itmundi
* @copyright Copyright (c) 2015, Itmundi
* @author Nerds & Company
* @copyright Copyright (c) 2015, Nerds & Company
* @license MIT
*
* @link http://www.itmundi.nl
* @link http://www.nerds.company
*/
class Schematic_AssetsService extends Schematic_AbstractService
{
Expand Down
Loading

0 comments on commit f4d4441

Please sign in to comment.