Give me feedback

  • Php object design - good practise to set attributes 0 reactions

    I have this Config class, taken from someone else project, and I'm trying to refactor it as an exercise. PHPMD guidelines say that an object shouldn't have more than 15 attributes. So I started working on this aspect and I'm looking for a good solution to improve the object. I will attach the

    wwr about 4 years ago
  • Php object design - good practise to set attributes 0 reactions

    I have this class (taken from someone else project) class Config { protected $database = array(); protected $hashMethod = 'bcrypt'; protected $defaultRounds = 8; protected $randomRounds = false; protected $minRounds = 5; protected $maxRounds = 9; //and 30+ othe

    wwr about 4 years ago
  • List to HTML Generator 0 reactions

    This is a simple class that converts a list into an html table. It accepts an array of strings as the table header, a map of strings that holds information such as css classes, id etc. As it is, the code runs and does what it is supposed to do. However, I am submitting this code in order to learn

    Adewale Afolabi about 4 years ago
  • First try after watching "Your code s*cks" - a codeigniter controller's code 1 reactions

    I've rewritten the controller of my newest project's control page, hope it s*cks less now. :)

    Krisztian Furesz about 4 years ago
  • Post.template.php 1 reactions

    <?php /** * Simple Machines Forum (SMF) * * @package SMF * @author Simple Machines * @copyright 2011 Simple Machines * @license http://www.simplemachines.org/about/smf/license.php BSD * * @version 2.0 */ // The main template for the post page. function template_main() { glo

    Orianthos about 5 years ago
  • Post.template.php 0 reactions

    <?php /** * Simple Machines Forum (SMF) * * @package SMF * @author Simple Machines * @copyright 2011 Simple Machines * @license http://www.simplemachines.org/about/smf/license.php BSD * * @version 2.0 */ // The main template for the post page. function template_main() { glo

    Orianthos about 5 years ago
  • Return Service Layer 0 reactions

    I have a Service called 'MessageService' with a create method that's receives my form parameters , creates ( also persist in database ) and return my Message domain object . But I have a rule that's say: "If the message has more than 200 chars you should save and show a warning to the user." Well

  • ddd 0 reactions

    dddd

    Pascal Borreli about 6 years ago
  • Putting together array for symfony 2's renderView method 5 reactions

    I need to pass an array of values to symfony 2's renderView method, so that they are availabe in the twig template. One of the values is an array of objects which I get from another action in the same controller. That action returns an array (it needs to stay like this for other uses), so I have t

    Tocacar about 6 years ago
  • Object Oriented Design 3 reactions

    I have three classes in my domain: User , Panel and Color And the following rules: Each user has many panels. Each panel has one color. I need one method to calculate the number of panels by color and user. Where the best place to put this behavior? Initially I had placed in the panel´s