Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Developer Bundle Laravel Package

alterphp/developer-bundle

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation:

    composer require alterphp/developer-bundle
    

    Add to config/bundles.php (Symfony 3.x+):

    return [
        // ...
        Alterphp\DeveloperBundle\AlterphpDeveloperBundle::class => ['all' => true],
    ];
    
  2. First Use Case:

    • Doctrine Fixtures: Leverage nelmio/alice for quick fixture generation.
      # config/packages/nelmio_alice.yaml
      nelmio_alice:
          fixtures:
              - %kernel.project_dir%/tests/fixtures/alice.yaml
      
    • Test Data: Use doctrine-fixtures-bundle for bulk data seeding.
  3. Key Features to Explore:

    • alterphp/components: Check for utility classes (e.g., debug helpers).
    • Symfony 2.3/3.0 Compatibility: Verify your environment matches the supported versions.

Implementation Patterns

Workflow Integration

  1. Fixture-Based Testing:

    • Define fixtures in tests/fixtures/alice.yaml:
      App\Entity\User:
          user{1..10}:
              email: <email()>
              roles: ['ROLE_USER']
      
    • Load fixtures in tests:
      use Nelmio\Alice\Loader\NativeLoader;
      
      $loader = new NativeLoader();
      $objects = $loader->load(__DIR__.'/fixtures/alice.yaml');
      
  2. Debugging Utilities:

    • Use alterphp/components for custom debug tools (e.g., dumping complex objects):
      use Alterphp\Components\Debug\Dumper;
      
      Dumper::dump($entity); // Enhanced var_dump
      
  3. Symfony Console Commands:

    • Extend the bundle’s commands (if available) or create custom ones:
      namespace App\Command;
      
      use Symfony\Component\Console\Command\Command;
      use Symfony\Component\Console\Input\InputInterface;
      use Symfony\Component\Console\Output\OutputInterface;
      
      class CustomCommand extends Command {
          protected function execute(InputInterface $input, OutputInterface $output) {
              $output->writeln('DeveloperBundle integrated!');
          }
      }
      

Common Use Cases

  • Rapid Prototyping: Use fixtures to populate test databases without manual SQL.
  • Legacy Migration: Seed old data into new schemas via fixtures.
  • Local Development: Quickly reset dev databases with doctrine:fixtures:load.

Gotchas and Tips

Pitfalls

  1. Symfony Version Lock:

    • Bundle requires Symfony 2.3 or 3.0. Avoid using with Symfony 4+ without forks.
    • Fix: Use composer require symfony/symfony:^3.0 if migrating from Symfony 2.
  2. Fixtures Overhead:

    • Large fixture sets may slow tests. Use --env=test and --no-debug flags:
      php bin/console doctrine:fixtures:load --env=test --no-debug
      
  3. Undocumented Components:

    • alterphp/components may lack docs. Inspect the source for undocumented helpers.

Debugging Tips

  • Enable Debug Mode:
    # config/packages/dev/debug.yaml
    framework:
        debug: true
    
  • Log Fixture Loading:
    php bin/console doctrine:fixtures:load -v
    

Extension Points

  1. Custom Fixture Loaders: Override Nelmio\Alice\Loader\LoaderInterface for custom logic:

    namespace App\Loader;
    
    use Nelmio\Alice\Loader\LoaderInterface;
    
    class CustomLoader implements LoaderInterface {
        public function load($file, array $parameters = []) {
            // Custom logic
        }
    }
    
  2. Post-Install Checks:

    • Verify alterphp/components is auto-loaded (check composer.json).
    • Test with a minimal fixture to confirm integration:
      # tests/fixtures/minimal.yaml
      App\Entity\TestEntity: ~
      
  3. Performance:

    • Disable fixtures in production:
      # config/packages/prod/nelmio_alice.yaml
      nelmio_alice:
          enabled: false
      
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor