generated from likesistemas/composer-empty
-
Notifications
You must be signed in to change notification settings - Fork 2
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 #1 from likesistemas/first-stable-release
🎉 First stable release
- Loading branch information
Showing
21 changed files
with
391 additions
and
32 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
CREATE TABLE `products` ( | ||
`id` int(6) NOT NULL, | ||
`subcategory_id` int(6) NOT NULL, | ||
`name` varchar(100) NOT NULL, | ||
`reference` int(10) NULL DEFAULT NULL, | ||
`price` decimal(10,2) NOT NULL DEFAULT 0.00 | ||
) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ||
|
||
CREATE TABLE `subcategories` ( | ||
`id` int(6) NOT NULL, | ||
`name` varchar(40) NOT NULL | ||
) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ||
|
||
ALTER TABLE `products` | ||
ADD PRIMARY KEY (`id`); | ||
|
||
ALTER TABLE `subcategories` | ||
ADD PRIMARY KEY (`id`); | ||
|
||
ALTER TABLE `products` | ||
MODIFY `id` int(6) NOT NULL AUTO_INCREMENT; | ||
|
||
ALTER TABLE `subcategories` | ||
MODIFY `id` int(6) NOT NULL AUTO_INCREMENT; | ||
COMMIT; |
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
GITHUB_TOKEN= | ||
CODECOMMIT_USER= | ||
CODECOMMIT_PASSWORD= | ||
PHP_VERSION=56|73|74|80 | ||
PHP_VERSION=56|73|74|80 | ||
PMA_PORT= |
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,18 @@ | ||
version: '3.7' | ||
|
||
networks: | ||
github: | ||
name: github | ||
driver: bridge | ||
|
||
services: | ||
|
||
phpmyadmin: | ||
image: phpmyadmin/phpmyadmin:latest | ||
environment: | ||
- PMA_HOSTS=mysql | ||
- UPLOAD_LIMIT=300M | ||
ports: | ||
- ${PMA_PORT:-9000}:80 | ||
networks: | ||
- github |
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,13 @@ | ||
<?php | ||
|
||
namespace Like\Eloquent\IdeHelper; | ||
|
||
use Like\Eloquent\IdeHelper\Commands\GenerateDocsModelsCommand; | ||
use Symfony\Component\Console\Application as ConsoleApplication; | ||
|
||
class Application extends ConsoleApplication { | ||
public function __construct() { | ||
parent::__construct('ide-helper'); | ||
$this->add(new GenerateDocsModelsCommand()); | ||
} | ||
} |
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,49 @@ | ||
<?php | ||
|
||
namespace Like\Eloquent\IdeHelper\Commands; | ||
|
||
use Illuminate\Container\Container; | ||
use Like\Eloquent\IdeHelper\Config; | ||
use LogicException; | ||
use Symfony\Component\Console\Command\Command; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
use Symfony\Component\Console\Style\SymfonyStyle; | ||
|
||
abstract class AbstractCommand extends Command { | ||
|
||
/** | ||
* @var SymfonyStyle | ||
*/ | ||
protected $style; | ||
|
||
public function initialize(InputInterface $input, OutputInterface $output) { | ||
$this->style = new SymfonyStyle($input, $output); | ||
|
||
if (! Container::getInstance()->bound('config')) { | ||
$this->loadConfig(); | ||
} | ||
} | ||
|
||
private function loadConfig() { | ||
$cwd = getcwd() . DIRECTORY_SEPARATOR; | ||
$filename = 'ide-helper.php'; | ||
$src = $cwd . $filename; | ||
|
||
if (! file_exists($src)) { | ||
throw new LogicException("Config file not found. Filename: {$src}."); | ||
} | ||
|
||
$config = include($src); | ||
|
||
if (! $config instanceof Config) { | ||
throw new LogicException("Config not is \Like\Eloquent\IdeHelper\Config."); | ||
} | ||
|
||
Container::getInstance()->instance('config', $config); | ||
|
||
$this->style->title('Reading configurations...'); | ||
$this->style->text('Using base path: ' . base_path()); | ||
$this->style->text('Using models folders: ' . join(', ', $config['ide-helper.model_locations'])); | ||
} | ||
} |
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,33 @@ | ||
<?php | ||
|
||
namespace Like\Eloquent\IdeHelper\Commands; | ||
|
||
use Barryvdh\LaravelIdeHelper\Console\ModelsCommand; | ||
use Illuminate\Container\Container; | ||
use Illuminate\Filesystem\Filesystem; | ||
use Symfony\Component\Console\Input\ArrayInput; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\ConsoleOutput; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
||
class GenerateDocsModelsCommand extends AbstractCommand { | ||
public function __construct() { | ||
parent::__construct('generate-docs-models'); | ||
} | ||
|
||
public function configure() { | ||
$this->setAliases(['models']); | ||
} | ||
|
||
protected function execute(InputInterface $input, OutputInterface $output) { | ||
$this->style->title('Writing documentation to models'); | ||
|
||
$fileSystem = new Filesystem(); | ||
$command = new ModelsCommand($fileSystem); | ||
$command->setLaravel(Container::getInstance()); | ||
return $command->run( | ||
new ArrayInput(['--write' => true, '--reset' => true]), | ||
new ConsoleOutput() | ||
); | ||
} | ||
} |
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,39 @@ | ||
<?php | ||
|
||
namespace Like\Eloquent\IdeHelper; | ||
|
||
use ArrayAccess; | ||
use Illuminate\Support\Arr; | ||
use RuntimeException; | ||
|
||
class Config implements ArrayAccess { | ||
|
||
/** | ||
* @var array | ||
*/ | ||
private $config = []; | ||
|
||
public function __construct(array $config) { | ||
$this->config = $config; | ||
} | ||
|
||
public function get($key, $defaultVaue = null) { | ||
return Arr::get($this->config, $key, $defaultVaue); | ||
} | ||
|
||
public function offsetExists($offset) { | ||
throw new RuntimeException('Not implemented because we didn\'t need it yet'); | ||
} | ||
|
||
public function offsetGet($offset) { | ||
return $this->get($offset); | ||
} | ||
|
||
public function offsetSet($offset, $value) { | ||
throw new RuntimeException('Not implemented because we didn\'t need it yet'); | ||
} | ||
|
||
public function offsetUnset($offset) { | ||
throw new RuntimeException('Not implemented because we didn\'t need it yet'); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,13 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
use Like\Eloquent\IdeHelper\Application; | ||
|
||
include __DIR__ . '/../laravel-functions.php'; | ||
|
||
if (! class_exists(Application::class)) { | ||
include $_composer_autoload_path ?? __DIR__ . '/../../vendor/autoload.php'; | ||
} | ||
|
||
$app = new Application(); | ||
$app->run(); |
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,11 @@ | ||
<?php | ||
|
||
use Illuminate\Container\Container; | ||
|
||
function base_path() { | ||
return Container::getInstance()->resolved('base-path') ?: getcwd(); | ||
} | ||
|
||
function config() { | ||
return Container::getInstance()->resolved('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,12 @@ | ||
<?php | ||
|
||
namespace Like\Eloquent\IdeHelper\Tests; | ||
|
||
use Like\Eloquent\IdeHelper\Application; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class ApplicationTest extends TestCase { | ||
public function testInstance() { | ||
$this->assertInstanceOf(Application::class, new Application()); | ||
} | ||
} |
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,47 @@ | ||
<?php | ||
|
||
namespace Like\Eloquent\IdeHelper\Tests; | ||
|
||
use Like\Database\Config as DatabaseConfig; | ||
|
||
class Config implements DatabaseConfig { | ||
const DRIVER = 'mysql'; | ||
const HOST = 'mysql'; | ||
const USER = 'root'; | ||
const PASSWORD = 'root'; | ||
const DB = 'eloquent'; | ||
const FACTORY_FOLDER = __DIR__ . '/./Factories/'; | ||
const FAKER_LANGUAGE = 'pt_BR'; | ||
|
||
public function getDriver() { | ||
return self::DRIVER; | ||
} | ||
|
||
public function getHost() { | ||
return self::HOST; | ||
} | ||
|
||
public function getDb() { | ||
return self::DB; | ||
} | ||
|
||
public function getUser() { | ||
return self::USER; | ||
} | ||
|
||
public function getPassword() { | ||
return self::PASSWORD; | ||
} | ||
|
||
public function getFactoryFolder() { | ||
return self::FACTORY_FOLDER; | ||
} | ||
|
||
public function getFakerLanguage() { | ||
return self::FAKER_LANGUAGE; | ||
} | ||
|
||
public function getFakerProviders() { | ||
return []; | ||
} | ||
} |
Oops, something went wrong.