-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from coenjacobs/classmap-implementation
Classmap implementation
- Loading branch information
Showing
13 changed files
with
267 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,5 @@ | |
|
||
interface Autoloader | ||
{ | ||
|
||
public function processConfig( $config ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace CoenJacobs\Mozart\Composer\Autoload; | ||
|
||
class Classmap implements Autoloader | ||
{ | ||
/** @var array */ | ||
public $files = []; | ||
|
||
/** @var array */ | ||
public $paths = []; | ||
|
||
public function processConfig($config) | ||
{ | ||
foreach( $config as $value) { | ||
if ('.php' == substr($value, '-4', 4)) { | ||
array_push($this->files, $value); | ||
} else { | ||
array_push($this->paths, $value); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace CoenJacobs\Mozart\Composer\Autoload; | ||
|
||
abstract class NamespaceAutoloader implements Autoloader | ||
{ | ||
/** @var string */ | ||
public $namespace = ''; | ||
|
||
/** @var array */ | ||
public $paths = []; | ||
|
||
public function processConfig($config) | ||
{ | ||
foreach( $config as $key => $value) { | ||
$this->namespace = $key; | ||
array_push( $this->paths, $value); | ||
} | ||
} | ||
|
||
public function getSearchNamespace() | ||
{ | ||
return $this->namespace; | ||
} | ||
|
||
public function getNamespacePath() | ||
{ | ||
return ''; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace CoenJacobs\Mozart\Replace; | ||
|
||
use CoenJacobs\Mozart\Composer\Autoload\Autoloader; | ||
|
||
abstract class BaseReplacer implements Replacer | ||
{ | ||
/** @var Autoloader */ | ||
public $autoloader; | ||
|
||
public function setAutoloader( $autoloader ) | ||
{ | ||
$this->autoloader = $autoloader; | ||
} | ||
} |
Oops, something went wrong.