Git Product home page Git Product logo

snowtricks's Introduction

snowtricks

Run Locally

Clone the project

  git clone https://github.com/AxelBuob/snowtricks.git
  cd my-project

Dependencies management

    composer install

Environment variables configuration

    // .env or .env.local
    - DATABASE_URL=mysql://db_user:[email protected]:3306/db_name?serverVersion=5.7

Create database

  php/bin console doctrine:database:create
  php/bin console doctrine:migrations:migrate
  php/bin console doctrine:fixtures:load

Start the server

  php/bin console server:start

Assets management

  yarn dev

Symfony insight report

snowtricks's People

Contributors

axelbuob avatar

Watchers

James Cloos avatar

snowtricks's Issues

[Insight] Your project database queries must use safety features such as bindings - in src/Controller/ImageController.php, line 72

in src/Controller/ImageController.php, line 72

If provided by the user, the value of $image->getId() may allow an SQL injection attack. Avoid concatenating parameters to SQL query strings, and use parameter binding instead.

    #[Route('/supprimer-figure-image/{id}', name: 'post_image_delete', methods: ["DELETE"])]
    public function deleteImage(Image $image, Request $request): JsonResponse
    {
        $this->denyAccessUnlessGranted('EDIT', $image);
        $data = json_decode($request->getContent(), true);
        if ($this->isCsrfTokenValid('delete' . $image->getId(), $data['_token'])) {

            $this->delete($this->getuser(), $image, '/post');
            $this->entityManager->remove($image);
            $this->entityManager->flush();

Posted from SymfonyInsight

[Insight] Your project should not contain commented code - in src/Controller/ImageController.php, line 46

in src/Controller/ImageController.php, line 46

Commented out code reduces readability and lowers the code confidence for other developers. If it's common usage for debug, it should not be committed. Using a version control system, such code can be safely removed.

    public function add(User $user, $image, $upload_directory, Post $post = null)
    {
        $image = $this->fileUploader->upload($image, $upload_directory, $this->slugger);

        //$user->setAvatar($image);
        $image->setOwner($user);
        if($post)
        {
            $post->addImage($image);
            

Posted from SymfonyInsight

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.